[PATCH] builtin-branch: be prepared for ref-logging
- From
- Lars Hjemli <hjemli@gmail.com>
- Date
- Feb 3, 2007, 18:17 UTC
- Message-ID
- <11705266492308-git-send-email-hjemli@gmail.com>
- In-Reply-To
- <11705213662728-git-send-email-tutufan@gmail.com>
The test for reflog parameter to create_branch() should also have tested for log_all_ref_updates. But there is no good reason not to prepare a reflog message, so lets just do it.
Signed-off-by: Lars Hjemli <hjemli@gmail.com> ---
If log_all_ref_updates==1 then the reflog will get an empty message with your patch. That is better than using an uninitialized message, but I think it's still better to just prepare a proper message.
builtin-branch.c | 7 +------ 1 files changed, 1 insertions(+), 6 deletions(-)
diff --git a/builtin-branch.c b/builtin-branch.c index d60690b..16b589e 100644 --- a/builtin-branch.c +++ b/builtin-branch.c @@ -342,12 +342,7 @@ static void create_branch(const char *name, const char *start_name, if (!lock) die("Failed to lock ref for update: %s.", strerror(errno)); - if (reflog) { - log_all_ref_updates = 1; - snprintf(msg, sizeof msg, "branch: Created from %s", - start_name); - } - + snprintf(msg, sizeof msg, "branch: Created from %s", start_name); if (write_ref_sha1(lock, sha1, msg) < 0) die("Failed to write ref: %s.", strerror(errno)); }
-- 1.5.0.rc2.ge4b0e