summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2012-11-25 18:44:17 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2012-11-25 18:44:17 -0800
commitcf22e272e48a1b00ea0288400e1363ac41c5eb99 (patch)
tree6e947c4e5220c13df5ebb3ed98d517d5af2b106b /t
parentMerge branch 'lt/diff-stat-show-0-lines' (diff)
parentFix failure to delete a packed ref through a symref (diff)
downloadtgif-cf22e272e48a1b00ea0288400e1363ac41c5eb99.tar.xz
Merge branch 'jh/update-ref-d-through-symref'
"update-ref -d --deref SYM" to delete a ref through a symbolic ref that points to it did not remove it correctly. * jh/update-ref-d-through-symref: Fix failure to delete a packed ref through a symref t1400-update-ref: Add test verifying bug with symrefs in delete_ref()
Diffstat (limited to 't')
-rwxr-xr-xt/t1400-update-ref.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/t/t1400-update-ref.sh b/t/t1400-update-ref.sh
index 4fd83a667a..e415ee0bbf 100755
--- a/t/t1400-update-ref.sh
+++ b/t/t1400-update-ref.sh
@@ -74,6 +74,24 @@ test_expect_success "delete $m (by HEAD)" '
'
rm -f .git/$m
+test_expect_success \
+ "create $m (by HEAD)" \
+ "git update-ref HEAD $A &&
+ test $A"' = $(cat .git/'"$m"')'
+test_expect_success \
+ "pack refs" \
+ "git pack-refs --all"
+test_expect_success \
+ "move $m (by HEAD)" \
+ "git update-ref HEAD $B $A &&
+ test $B"' = $(cat .git/'"$m"')'
+test_expect_success "delete $m (by HEAD) should remove both packed and loose $m" '
+ git update-ref -d HEAD $B &&
+ ! grep "$m" .git/packed-refs &&
+ ! test -f .git/$m
+'
+rm -f .git/$m
+
cp -f .git/HEAD .git/HEAD.orig
test_expect_success "delete symref without dereference" '
git update-ref --no-deref -d HEAD &&