summaryrefslogtreecommitdiff
path: root/builtin-fetch.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-05-18 08:59:27 -0700
committerJunio C Hamano <gitster@pobox.com>2009-05-18 08:59:27 -0700
commit983e9b63aecf1923ef5809fe13ed107105627262 (patch)
tree0fe7d1769c0b502bd120e2bdd7678385d9a90398 /builtin-fetch.c
parent59e5fb356ee6abf022e03c446df83879c727b94c (diff)
parent47abd85ba06ed7209d1caa3e5ac7cc6b232bece4 (diff)
downloadgit-983e9b63aecf1923ef5809fe13ed107105627262.tar.gz
Merge branch 'ae/anon-fetch-info'
* ae/anon-fetch-info: fetch: Strip usernames from url's before storing them
Diffstat (limited to 'builtin-fetch.c')
-rw-r--r--builtin-fetch.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/builtin-fetch.c b/builtin-fetch.c
index ec75df0900..b944cac6e6 100644
--- a/builtin-fetch.c
+++ b/builtin-fetch.c
@@ -289,7 +289,7 @@ static int update_local_ref(struct ref *ref,
}
}
-static int store_updated_refs(const char *url, const char *remote_name,
+static int store_updated_refs(const char *raw_url, const char *remote_name,
struct ref *ref_map)
{
FILE *fp;
@@ -298,11 +298,13 @@ static int store_updated_refs(const char *url, const char *remote_name,
char note[1024];
const char *what, *kind;
struct ref *rm;
- char *filename = git_path("FETCH_HEAD");
+ char *url, *filename = git_path("FETCH_HEAD");
fp = fopen(filename, "a");
if (!fp)
return error("cannot open %s: %s\n", filename, strerror(errno));
+
+ url = transport_anonymize_url(raw_url);
for (rm = ref_map; rm; rm = rm->next) {
struct ref *ref = NULL;
@@ -382,6 +384,7 @@ static int store_updated_refs(const char *url, const char *remote_name,
fprintf(stderr, " %s\n", note);
}
}
+ free(url);
fclose(fp);
if (rc & 2)
error("some local refs could not be updated; try running\n"