Code clean-up.
* km/t1400-modernization:
t1400: use test_when_finished for cleanup
t1400: remove a set of unused output files
t1400: use test_path_is_* helpers
t1400: set core.logAllRefUpdates in "logged by touch" tests
t1400: rename test descriptions to be unique
test_expect_success "fail to delete $m with stale ref" '
@ -48,31 +48,31 @@ test_expect_success "fail to delete $m with stale ref" '
@@ -48,31 +48,31 @@ test_expect_success "fail to delete $m with stale ref" '
test $B = "$(cat .git/$m)"
'
test_expect_success "delete $m" '
test_when_finished "rm -f .git/$m" &&
git update-ref -d $m $B &&
! test -f .git/$m
test_path_is_missing .git/$m
'
rm -f .git/$m
test_expect_success "delete $m without oldvalue verification" "
test_expect_success "delete $m without oldvalue verification" '
test_when_finished "rm -f .git/$m" &&
git update-ref $m $A &&
test $A = \$(cat .git/$m) &&
test $A = $(cat .git/$m) &&
git update-ref -d $m &&
! test -f .git/$m
"
rm -f .git/$m
test_path_is_missing .git/$m
'
test_expect_success \
"fail to create $n" \
"touch .git/$n_dir &&
test_must_fail git update-ref $n $A >out 2>err"
rm -f .git/$n_dir out err
test_expect_success "fail to create $n" '
test_when_finished "rm -f .git/$n_dir" &&
touch .git/$n_dir &&
test_must_fail git update-ref $n $A
'
test_expect_success \
"create $m (by HEAD)" \
"git update-ref HEAD $A &&
test $A"' = $(cat .git/'"$m"')'
test_expect_success \
"create $m (by HEAD)" \
"create $m (by HEAD) with oldvalue verification" \
"git update-ref HEAD $B $A &&
test $B"' = $(cat .git/'"$m"')'
test_expect_success "fail to delete $m (by HEAD) with stale ref" '
@ -80,28 +80,28 @@ test_expect_success "fail to delete $m (by HEAD) with stale ref" '
@@ -80,28 +80,28 @@ test_expect_success "fail to delete $m (by HEAD) with stale ref" '
test $B = $(cat .git/$m)
'
test_expect_success "delete $m (by HEAD)" '
test_when_finished "rm -f .git/$m" &&
git update-ref -d HEAD $B &&
! test -f .git/$m
test_path_is_missing .git/$m
'
rm -f .git/$m
test_expect_success "deleting current branch adds message to HEAD's log" '
test_when_finished "rm -f .git/$m" &&
git update-ref $m $A &&
git symbolic-ref HEAD $m &&
git update-ref -m delete-$m -d $m &&
! test -f .git/$m &&
test_path_is_missing .git/$m &&
grep "delete-$m$" .git/logs/HEAD
'
rm -f .git/$m
test_expect_success "deleting by HEAD adds message to HEAD's log" '
test_when_finished "rm -f .git/$m" &&
git update-ref $m $A &&
git symbolic-ref HEAD $m &&
git update-ref -m delete-by-head -d HEAD &&
! test -f .git/$m &&
test_path_is_missing .git/$m &&
grep "delete-by-head$" .git/logs/HEAD
'
rm -f .git/$m
test_expect_success 'update-ref does not create reflogs by default' '
test_expect_success 'update-ref -d is not confused by self-reference' '
@ -241,10 +242,10 @@ test_expect_success 'update-ref --no-deref -d can delete reference to bad ref' '
@@ -241,10 +242,10 @@ test_expect_success 'update-ref --no-deref -d can delete reference to bad ref' '
test_expect_success '(not) create HEAD with old sha1' "
test_must_fail git update-ref HEAD $A $B
"
test_expect_success "(not) prior created .git/$m" "
! test -f .git/$m
"
rm -f .git/$m
test_expect_success "(not) prior created .git/$m" '