summaryrefslogtreecommitdiff
path: root/builtin/show-branch.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-09-09 21:30:35 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-09-09 21:30:35 (GMT)
commitf0bc85462332644ecd2386e0f4fdc9948b9f47dc (patch)
tree6ee0f442ec888c33a25e825a4e451b921c0701ff /builtin/show-branch.c
parent7a2c4af7a82eebf2ed0e60a2b36c31e70c619264 (diff)
parent27ea6f85beff1173ec74349fa35c45951feee570 (diff)
downloadgit-f0bc85462332644ecd2386e0f4fdc9948b9f47dc.zip
git-f0bc85462332644ecd2386e0f4fdc9948b9f47dc.tar.gz
git-f0bc85462332644ecd2386e0f4fdc9948b9f47dc.tar.bz2
Sync with 2.5.2
Diffstat (limited to 'builtin/show-branch.c')
-rw-r--r--builtin/show-branch.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/builtin/show-branch.c b/builtin/show-branch.c
index c87c46e..408ce70 100644
--- a/builtin/show-branch.c
+++ b/builtin/show-branch.c
@@ -730,7 +730,6 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
if (reflog) {
struct object_id oid;
- char nth_desc[256];
char *ref;
int base = 0;
unsigned int flags = 0;
@@ -769,6 +768,7 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
for (i = 0; i < reflog; i++) {
char *logmsg;
+ char *nth_desc;
const char *msg;
unsigned long timestamp;
int tz;
@@ -788,8 +788,10 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
DATE_MODE(RELATIVE)),
msg);
free(logmsg);
- sprintf(nth_desc, "%s@{%d}", *av, base+i);
+
+ nth_desc = xstrfmt("%s@{%d}", *av, base+i);
append_ref(nth_desc, &oid, 1);
+ free(nth_desc);
}
free(ref);
}