commit | e22be3d718e7d9b869179f3aba2f124c0e6676fa | [log] [tgz] |
---|---|---|
author | natalie.chen <natalie.chen@mediatek.com> | Thu Jun 25 09:33:52 2015 +0800 |
committer | natalie.chen <natalie.chen@mediatek.com> | Thu Aug 13 13:21:30 2015 +0800 |
tree | 2dab40216b69b91f97934cc6242a588de525a3ca | |
parent | cd4d6bba1d83479f916087c364edde09ca67978b [diff] [blame] |
trim uri to get the right project name
diff --git a/src/backend.c b/src/backend.c index 14908dd..0186768 100644 --- a/src/backend.c +++ b/src/backend.c
@@ -212,6 +212,15 @@ depth = 2; end--; } + + //get rid of redundant '/' + while ((end - start) > 1 && *(start+1) == '/') + start++; + while ((end - start) > 1 && *(end-1) == '/') + end--; + //get rid of trailing ".git" + if ((end - start) > 4 && strcmp(end-4, ".git") == 0) + end -= 4; hash = gen_hash(px, start, (end - start));