File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,14 @@ test_expect_success \
3232 " create $m " \
3333 " git update-ref $m $B $A &&
3434 test $B " ' = $(cat .git/' " $m " ' )'
35+ test_expect_success " fail to delete $m with stale ref" '
36+ test_must_fail git update-ref -d $m $A &&
37+ test $B = "$(cat .git/$m)"
38+ '
39+ test_expect_success " delete $m " '
40+ git update-ref -d $m $B &&
41+ ! test -f .git/$m
42+ '
3543rm -f .git/$m
3644
3745test_expect_success \
@@ -49,6 +57,14 @@ test_expect_success \
4957 " create $m (by HEAD)" \
5058 " git update-ref HEAD $B $A &&
5159 test $B " ' = $(cat .git/' " $m " ' )'
60+ test_expect_success " fail to delete $m (by HEAD) with stale ref" '
61+ test_must_fail git update-ref -d HEAD $A &&
62+ test $B = $(cat .git/$m)
63+ '
64+ test_expect_success " delete $m (by HEAD)" '
65+ git update-ref -d HEAD $B &&
66+ ! test -f .git/$m
67+ '
5268rm -f .git/$m
5369
5470test_expect_success ' (not) create HEAD with old sha1' "
You can’t perform that action at this time.
0 commit comments