refs.c: Write reflogs for notes just like for branch heads
The notes code intends to write reflog entries, but currently they are not written because log_ref_write() checks for the refname path explicitly. Add refs/notes to the list of allowed paths so that notes references are treated just like branch heads, i.e. according to core.logAllRefUpdates and core.bare. Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Acked-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Michael J Gruber committed
Mar 29, 2010 at 15:05 UTC
b2e256b0f0980dac6f0761d5bff0b43170022799
2 files changed
+2
-1
refs.c
+1
@@ -1276,6 +1276,7 @@ static int log_ref_write(const char *ref_name, const unsigned char *old_sha1,
1276
if (log_all_ref_updates &&
1277
(!prefixcmp(ref_name, "refs/heads/") ||
1278
!prefixcmp(ref_name, "refs/remotes/") ||
1279
+ !prefixcmp(ref_name, "refs/notes/") ||
1280
!strcmp(ref_name, "HEAD"))) {
1281
if (safe_create_leading_directories(log_file) < 0)
1282
return error("unable to create directory for %s",
t/t3301-notes.sh
+1
-1
@@ -69,7 +69,7 @@ cat >expect <<EOF
69
d423f8c refs/notes/commits@{0}: notes: Notes added by 'git notes add'
70
EOF
71
72
-test_expect_failure 'create reflog entry' '
72
+test_expect_success 'create reflog entry' '
73
git reflog show refs/notes/commits >output &&
74
test_cmp expect output
75
'