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:
Diffstat (limited to 'branch.c')
-rw-r--r--branch.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/branch.c b/branch.c
index 5c12036b02..6d0ca94cc7 100644
--- a/branch.c
+++ b/branch.c
@@ -234,7 +234,7 @@ void create_branch(const char *name, const char *start_name,
{
struct commit *commit;
unsigned char sha1[20];
- char *real_ref, msg[PATH_MAX + 20];
+ char *real_ref;
struct strbuf ref = STRBUF_INIT;
int forcing = 0;
int dont_change_ref = 0;
@@ -290,19 +290,20 @@ void create_branch(const char *name, const char *start_name,
die(_("Not a valid branch point: '%s'."), start_name);
hashcpy(sha1, commit->object.oid.hash);
- if (forcing)
- snprintf(msg, sizeof msg, "branch: Reset to %s",
- start_name);
- else if (!dont_change_ref)
- snprintf(msg, sizeof msg, "branch: Created from %s",
- start_name);
-
if (reflog)
log_all_ref_updates = LOG_REFS_NORMAL;
if (!dont_change_ref) {
struct ref_transaction *transaction;
struct strbuf err = STRBUF_INIT;
+ char msg[PATH_MAX + 20];
+
+ if (forcing)
+ snprintf(msg, sizeof msg, "branch: Reset to %s",
+ start_name);
+ else
+ snprintf(msg, sizeof msg, "branch: Created from %s",
+ start_name);
transaction = ref_transaction_begin(&err);
if (!transaction ||