summaryrefslogtreecommitdiff
path: root/t/t1410-reflog.sh
diff options
context:
space:
mode:
authorLibravatar David Turner <dturner@twopensource.com>2016-04-07 15:03:11 -0400
committerLibravatar Junio C Hamano <gitster@pobox.com>2016-04-10 11:35:46 -0700
commit41d796ed5cd78d159f8a8bfa3b54bdbe5d9383a3 (patch)
treeb1159d73e0dd45d1cc0f076a07ae49b488d834da /t/t1410-reflog.sh
parentrefs: move resolve_ref_unsafe into common code (diff)
downloadtgif-41d796ed5cd78d159f8a8bfa3b54bdbe5d9383a3.tar.xz
refs: on symref reflog expire, lock symref not referrent
When locking a symbolic ref to expire a reflog, lock the symbolic ref (using REF_NODEREF) instead of its referent. Add a test for this. Signed-off-by: David Turner <dturner@twopensource.com> Reviewed-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t1410-reflog.sh')
-rwxr-xr-xt/t1410-reflog.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/t/t1410-reflog.sh b/t/t1410-reflog.sh
index c623824b4d..9cf91dc6d2 100755
--- a/t/t1410-reflog.sh
+++ b/t/t1410-reflog.sh
@@ -338,4 +338,14 @@ test_expect_failure 'reflog with non-commit entries displays all entries' '
test_line_count = 3 actual
'
+test_expect_success 'reflog expire operates on symref not referrent' '
+ git branch -l the_symref &&
+ git branch -l referrent &&
+ git update-ref referrent HEAD &&
+ git symbolic-ref refs/heads/the_symref refs/heads/referrent &&
+ test_when_finished "rm -f .git/refs/heads/referrent.lock" &&
+ touch .git/refs/heads/referrent.lock &&
+ git reflog expire --expire=all the_symref
+'
+
test_done