diff options
Diffstat (limited to 'branch.c')
-rw-r--r-- | branch.c | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -296,14 +296,12 @@ void create_branch(const char *name, const char *start_name, if (!dont_change_ref) { struct ref_transaction *transaction; struct strbuf err = STRBUF_INIT; - char msg[PATH_MAX + 20]; + char *msg; if (forcing) - snprintf(msg, sizeof msg, "branch: Reset to %s", - start_name); + msg = xstrfmt("branch: Reset to %s", start_name); else - snprintf(msg, sizeof msg, "branch: Created from %s", - start_name); + msg = xstrfmt("branch: Created from %s", start_name); transaction = ref_transaction_begin(&err); if (!transaction || @@ -314,6 +312,7 @@ void create_branch(const char *name, const char *start_name, die("%s", err.buf); ref_transaction_free(transaction); strbuf_release(&err); + free(msg); } if (real_ref && track) |