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:
Karl Hasselström
2008-06-03 01:34:53 +02:00
committed by Junio C Hamano
parent 973a70ea4d
commit 3fe8dce6fc
3 changed files with 12 additions and 4 deletions

View File

@@ -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