diff options
author | Junio C Hamano <junkio@cox.net> | 2007-02-28 17:02:18 -0800 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2007-02-28 17:02:18 -0800 |
commit | 855b34680ea334f05385b3ad58232c3ccdca51d5 (patch) | |
tree | 991522c5b3617b7ab3f18a3745f59d173bcfc9fa /builtin-fetch--tool.c | |
parent | e6eebbb3ae2f2831fe1319d5acdb6477b8abeadb (diff) | |
download | git-855b34680ea334f05385b3ad58232c3ccdca51d5.tar.gz git-855b34680ea334f05385b3ad58232c3ccdca51d5.tar.xz |
builtin-fetch--tool: fix reflog notes.
Also the verbose output had unnecessary SHA1 and not-for-merge markers
leaked because append_fetch_head() cheated
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'builtin-fetch--tool.c')
-rw-r--r-- | builtin-fetch--tool.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/builtin-fetch--tool.c b/builtin-fetch--tool.c index 5261bf57f..e9d676455 100644 --- a/builtin-fetch--tool.c +++ b/builtin-fetch--tool.c @@ -181,16 +181,18 @@ static int append_fetch_head(FILE *fp, remote_len = i + 1; if (4 < i && !strncmp(".git", remote + i - 3, 4)) remote_len = i - 3; - note_len = sprintf(note, "%s\t%s\t", - sha1_to_hex(commit ? commit->object.sha1 : sha1), - not_for_merge ? "not-for-merge" : ""); + + note_len = 0; if (*what) { if (*kind) note_len += sprintf(note + note_len, "%s ", kind); note_len += sprintf(note + note_len, "'%s' of ", what); } note_len += sprintf(note + note_len, "%.*s", remote_len, remote); - fprintf(fp, "%s\n", note); + fprintf(fp, "%s\t%s\t%s\n", + sha1_to_hex(commit ? commit->object.sha1 : sha1), + not_for_merge ? "not-for-merge" : "", + note); return update_local_ref(local_name, head, note, verbose, force); } |