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>
This commit is contained in:
parent
e6eebbb3ae
commit
855b34680e
@ -181,16 +181,18 @@ static int append_fetch_head(FILE *fp,
|
|||||||
remote_len = i + 1;
|
remote_len = i + 1;
|
||||||
if (4 < i && !strncmp(".git", remote + i - 3, 4))
|
if (4 < i && !strncmp(".git", remote + i - 3, 4))
|
||||||
remote_len = i - 3;
|
remote_len = i - 3;
|
||||||
note_len = sprintf(note, "%s\t%s\t",
|
|
||||||
sha1_to_hex(commit ? commit->object.sha1 : sha1),
|
note_len = 0;
|
||||||
not_for_merge ? "not-for-merge" : "");
|
|
||||||
if (*what) {
|
if (*what) {
|
||||||
if (*kind)
|
if (*kind)
|
||||||
note_len += sprintf(note + note_len, "%s ", 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' of ", what);
|
||||||
}
|
}
|
||||||
note_len += sprintf(note + note_len, "%.*s", remote_len, remote);
|
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);
|
return update_local_ref(local_name, head, note, verbose, force);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user