mirror of
https://github.com/git/git.git
synced 2026-08-02 22:27:14 +00:00
Make old sha1 optional with git update-ref -d
Giving the old sha1 is already optional when changing a ref, and it's quite handy when running update-ref manually. So make it optional for deleting a ref too. Signed-off-by: Karl Hasselström <kha@treskal.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
973a70ea4d
commit
3fe8dce6fc
@@ -42,6 +42,14 @@ test_expect_success "delete $m" '
|
||||
'
|
||||
rm -f .git/$m
|
||||
|
||||
test_expect_success "delete $m without oldvalue verification" "
|
||||
git update-ref $m $A &&
|
||||
test $A = \$(cat .git/$m) &&
|
||||
git update-ref -d $m &&
|
||||
! test -f .git/$m
|
||||
"
|
||||
rm -f .git/$m
|
||||
|
||||
test_expect_success \
|
||||
"fail to create $n" \
|
||||
"touch .git/$n_dir
|
||||
|
||||
Reference in New Issue
Block a user