Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-09-04 20:29:28 +0300
committerJunio C Hamano <gitster@pobox.com>2015-09-04 20:29:28 +0300
commit8267cd11d677f1a5f8441ac2880f5e9d48dba60b (patch)
tree377d0d4141d50fbf44f68896a7e4f2e18ecd18ff /builtin/show-branch.c
parent9a3d637541a5b6fcd84b6f5fa057e597d1696460 (diff)
parent441c4a40173fe1ee8a5c0094e587dfc47e2a6460 (diff)
Sync with 2.2.3
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 365228aa8d..808225cddc 100644
--- a/builtin/show-branch.c
+++ b/builtin/show-branch.c
@@ -723,7 +723,6 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
if (reflog) {
unsigned char sha1[20];
- char nth_desc[256];
char *ref;
int base = 0;
unsigned int flags = 0;
@@ -762,6 +761,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;
@@ -780,8 +780,10 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
show_date(timestamp, tz, 1),
msg);
free(logmsg);
- sprintf(nth_desc, "%s@{%d}", *av, base+i);
+
+ nth_desc = xstrfmt("%s@{%d}", *av, base+i);
append_ref(nth_desc, sha1, 1);
+ free(nth_desc);
}
free(ref);
}