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));