summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c0234b2)
raw | patch | inline | side by side (parent: c0234b2)
author | Junio C Hamano <gitster@pobox.com> | |
Sun, 6 Jul 2008 09:54:56 +0000 (02:54 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 6 Jul 2008 09:54:56 +0000 (02:54 -0700) |
The codepath to emit relationship between the branch and what it tracks
forgot to initialize a string buffer stat[] to empty when showing a
tracking branch. This moves the emptying so that the buffer starts as
empty and stays so when no information is added to fix this issue.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
forgot to initialize a string buffer stat[] to empty when showing a
tracking branch. This moves the emptying so that the buffer starts as
empty and stays so when no information is added to fix this issue.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-branch.c | patch | blob | history |
diff --git a/builtin-branch.c b/builtin-branch.c
index e9423d1e4ce82b7b726358958f3da2fc34f6ca56..ff71f3d8a6dd784ae08f89b8a98136e4cd369295 100644 (file)
--- a/builtin-branch.c
+++ b/builtin-branch.c
int ours, theirs;
struct branch *branch = branch_get(branch_name);
- if (!stat_tracking_info(branch, &ours, &theirs) || (!ours && !theirs)) {
- stat[0] = '\0';
+ if (!stat_tracking_info(branch, &ours, &theirs) || (!ours && !theirs))
return;
- }
if (!ours)
sprintf(stat, "[behind %d] ", theirs);
else if (!theirs)
char stat[128];
strbuf_init(&subject, 0);
+ stat[0] = '\0';
commit = lookup_commit(item->sha1);
if (commit && !parse_commit(commit)) {