aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--0001-fix-name_from_url-removes-dot-git-ending.patch14
-rw-r--r--src/name_from_url.c2
2 files changed, 16 insertions, 0 deletions
diff --git a/0001-fix-name_from_url-removes-dot-git-ending.patch b/0001-fix-name_from_url-removes-dot-git-ending.patch
new file mode 100644
index 0000000..2bd68a5
--- /dev/null
+++ b/0001-fix-name_from_url-removes-dot-git-ending.patch
@@ -0,0 +1,14 @@
+diff --git a/src/name_from_url.c b/src/name_from_url.c
+index 67995fe..6b26560 100644
+--- a/src/name_from_url.c
++++ b/src/name_from_url.c
+@@ -32,6 +32,9 @@ char* name_from_url(const char *url) {
+ while (end > after_git && *(end-1) == '/') {
+ end--;
+ }
++ if (strncmp(end-4, ".git", 4) == 0) {
++ end -= 4;
++ }
+ const char *last_slash = end;
+ while (last_slash > after_git && *(last_slash-1) != '/') {
+ last_slash--;
diff --git a/src/name_from_url.c b/src/name_from_url.c
index d7d892e..c1efc6f 100644
--- a/src/name_from_url.c
+++ b/src/name_from_url.c
@@ -30,6 +30,8 @@ char* name_from_url(const char *url) {
const char *end = after_git + len;
while (end > after_git && *(end-1) == '/')
end--;
+ if (strncmp(end-4, ".git", 4) == 0)
+ end -= 4;
const char *last_slash = end;
while (last_slash > after_git && *(last_slash-1) != '/')
last_slash--;