summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: dfc2dcd)
raw | patch | inline | side by side (parent: dfc2dcd)
author | Tay Ray Chuan <rctay89@gmail.com> | |
Thu, 25 Nov 2010 08:21:09 +0000 (16:21 +0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 26 Nov 2010 22:50:46 +0000 (14:50 -0800) |
That way, we don't have to update repo->path and repo->path_len again
after adding the trailing slash.
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
after adding the trailing slash.
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
http-push.c | patch | blob | history |
diff --git a/http-push.c b/http-push.c
index bfa1fe7c0568d310555b293ad25fb4bdc37631a4..ff41a0e183dd3a449f5136c6d1488a31b4a8960b 100644 (file)
--- a/http-push.c
+++ b/http-push.c
int new_refs;
struct ref *ref, *local_refs;
struct remote *remote;
- char *rewritten_url = NULL;
git_extract_argv0_path(argv[0]);
}
if (!repo->url) {
char *path = strstr(arg, "//");
- repo->url = arg;
- repo->path_len = strlen(arg);
+ str_end_url_with_slash(arg, &repo->url);
+ repo->path_len = strlen(repo->url);
if (path) {
repo->path = strchr(path+2, '/');
if (repo->path)
remote->url[remote->url_nr++] = repo->url;
http_init(remote);
- if (repo->url && repo->url[strlen(repo->url)-1] != '/') {
- rewritten_url = xmalloc(strlen(repo->url)+2);
- strcpy(rewritten_url, repo->url);
- strcat(rewritten_url, "/");
- repo->path = rewritten_url + (repo->path - repo->url);
- repo->path_len++;
- repo->url = rewritten_url;
- }
-
#ifdef USE_CURL_MULTI
is_running_queue = 0;
#endif
}
cleanup:
- free(rewritten_url);
if (info_ref_lock)
unlock_remote(info_ref_lock);
free(repo);