From: Lars Hjemli <hjemli@gmail.com>
To: Michael Coleman <tutufan@gmail.com>
Cc: git@vger.kernel.org, Junio C Hamano <junkio@cox.net>
Subject: [PATCH] builtin-branch: be prepared for ref-logging
Date: Sat, 3 Feb 2007 19:17:29 +0100 [thread overview]
Message-ID: <11705266492308-git-send-email-hjemli@gmail.com> (raw)
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
next prev parent reply other threads:[~2007-02-03 18:17 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-03 16:49 [PATCH] fix use of sometimes uninitialized variable 'msg' Michael Coleman
2007-02-03 16:49 ` [PATCH] fix uninitialized use of msg buffer Michael Coleman
2007-02-03 18:17 ` Lars Hjemli [this message]
2007-02-03 18:55 ` [PATCH] builtin-branch: be prepared for ref-logging Junio C Hamano
2007-02-03 18:35 ` Lars Hjemli
2007-02-03 19:50 ` Junio C Hamano
2007-02-03 20:38 ` Lars Hjemli
2007-02-03 20:54 ` Junio C Hamano
2007-02-03 21:20 ` Lars Hjemli
2007-02-03 23:21 ` Junio C Hamano
2007-02-03 17:05 ` [PATCH] fix use of sometimes uninitialized variable 'msg' Mike Coleman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=11705266492308-git-send-email-hjemli@gmail.com \
--to=hjemli@gmail.com \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
--cc=tutufan@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.