summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1655707)
raw | patch | inline | side by side (parent: 1655707)
author | Nicolas Pitre <nico@cam.org> | |
Fri, 26 Jan 2007 22:26:07 +0000 (17:26 -0500) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sun, 28 Jan 2007 10:16:46 +0000 (02:16 -0800) |
If HEAD is tied to a branch then both logs/HEAD and logs/heads/<branch> are
updated. This is also true for any symbolic refs in general, but only HEAD
will see its reflog created automatically.
Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
updated. This is also true for any symbolic refs in general, but only HEAD
will see its reflog created automatically.
Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
refs.c | patch | blob | history |
index bd76ea65a904b098c80f6a719b28a316b79e9204..5b2ca086aa68c96d5c293190f074b1d59fa4e313 100644 (file)
--- a/refs.c
+++ b/refs.c
if (log_all_ref_updates &&
(!strncmp(ref_name, "refs/heads/", 11) ||
- !strncmp(ref_name, "refs/remotes/", 13))) {
+ !strncmp(ref_name, "refs/remotes/", 13) ||
+ !strcmp(ref_name, "HEAD"))) {
if (safe_create_leading_directories(log_file) < 0)
return error("unable to create directory for %s",
log_file);
return -1;
}
invalidate_cached_refs();
- if (log_ref_write(lock->ref_name, lock->old_sha1, sha1, logmsg) < 0) {
+ if (log_ref_write(lock->ref_name, lock->old_sha1, sha1, logmsg) < 0 ||
+ (strcmp(lock->ref_name, lock->orig_ref_name) &&
+ log_ref_write(lock->orig_ref_name, lock->old_sha1, sha1, logmsg) < 0)) {
unlock_ref(lock);
return -1;
}