aboutsummaryrefslogtreecommitdiff
path: root/t/t1400-update-ref.sh
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@frugalware.org>2008-11-01 00:25:44 +0100
committerJunio C Hamano <gitster@pobox.com>2008-10-31 22:41:55 -0700
commit045a476f91a9a308c823a2709977163238baa3fd (patch)
tree3743a1b43643d369f1c5a6598e58a61ac44b14b4 /t/t1400-update-ref.sh
parentfa58186c9ba50514b36ac5ef192cd7e0bc4d7780 (diff)
downloadgit-045a476f91a9a308c823a2709977163238baa3fd.tar.gz
git-045a476f91a9a308c823a2709977163238baa3fd.tar.xz
update-ref --no-deref -d: handle the case when the pointed ref is packed
In this case we did nothing in the past, but we should delete the reference in fact. The problem was that when the symref is not packed but the referenced ref is packed, then we assumed that the symref is packed as well, but symrefs are never packed. Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t1400-update-ref.sh')
-rwxr-xr-xt/t1400-update-ref.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/t/t1400-update-ref.sh b/t/t1400-update-ref.sh
index 8139cd6cc..bd589268f 100755
--- a/t/t1400-update-ref.sh
+++ b/t/t1400-update-ref.sh
@@ -82,6 +82,17 @@ test_expect_success "delete symref without dereference" '
'
cp -f .git/HEAD.orig .git/HEAD
+test_expect_success "delete symref without dereference when the referred ref is packed" '
+ echo foo >foo.c &&
+ git add foo.c &&
+ git commit -m foo &&
+ git pack-refs --all &&
+ git update-ref --no-deref -d HEAD &&
+ ! test -f .git/HEAD
+'
+cp -f .git/HEAD.orig .git/HEAD
+git update-ref -d $m
+
test_expect_success '(not) create HEAD with old sha1' "
test_must_fail git update-ref HEAD $A $B
"