[PATCH] builtin-branch: be prepared for ref-logging

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---

Sorry, the previous patch was obviously no good, since it didn't honour
the case where (reflog==1 && log_all_ref_updates==0)

This one should be better.


 builtin-branch.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/builtin-branch.c b/builtin-branch.c
index d60690b..a8c8c98 100644
--- a/builtin-branch.c
+++ b/builtin-branch.c
@@ -342,12 +342,10 @@ 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) {
+	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

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]