@@ -27,7 +27,9 @@ test_update_rejected () {
fi &&
printf "create $prefix/%s $C\n" $create >input &&
test_must_fail git update-ref --stdin <input 2>output.err &&
- test_i18ngrep -F "$error" output.err &&
+ if test_have_prereq REFFILES ; then
+ test_i18ngrep -F "$error" output.err
+ fi &&
git for-each-ref $prefix >actual &&
test_cmp unchanged actual
}
@@ -101,7 +103,9 @@ df_test() {
printf "%s\n" "delete $delname" "create $addname $D"
fi >commands &&
test_must_fail git update-ref --stdin <commands 2>output.err &&
- test_cmp expected-err output.err &&
+ if test_have_prereq REFFILES ; then
+ test_cmp expected-err output.err
+ fi &&
printf "%s\n" "$C $delref" >expected-refs &&
git for-each-ref --format="%(objectname) %(refname)" $prefix/r >actual-refs &&
test_cmp expected-refs actual-refs
@@ -336,7 +340,9 @@ test_expect_success 'missing old value blocks update' '
EOF
printf "%s\n" "update $prefix/foo $E $D" |
test_must_fail git update-ref --stdin 2>output.err &&
- test_cmp expected output.err
+ if test_have_prereq REFFILES ; then
+ test_cmp expected output.err
+ fi
'
test_expect_success 'incorrect old value blocks update' '
@@ -347,7 +353,9 @@ test_expect_success 'incorrect old value blocks update' '
EOF
printf "%s\n" "update $prefix/foo $E $D" |
test_must_fail git update-ref --stdin 2>output.err &&
- test_cmp expected output.err
+ if test_have_prereq REFFILES ; then
+ test_cmp expected output.err
+ fi
'
test_expect_success 'existing old value blocks create' '
@@ -358,7 +366,9 @@ test_expect_success 'existing old value blocks create' '
EOF
printf "%s\n" "create $prefix/foo $E" |
test_must_fail git update-ref --stdin 2>output.err &&
- test_cmp expected output.err
+ if test_have_prereq REFFILES ; then
+ test_cmp expected output.err
+ fi
'
test_expect_success 'incorrect old value blocks delete' '
@@ -369,7 +379,9 @@ test_expect_success 'incorrect old value blocks delete' '
EOF
printf "%s\n" "delete $prefix/foo $D" |
test_must_fail git update-ref --stdin 2>output.err &&
- test_cmp expected output.err
+ if test_have_prereq REFFILES ; then
+ test_cmp expected output.err
+ fi
'
test_expect_success 'missing old value blocks indirect update' '
@@ -380,7 +392,9 @@ test_expect_success 'missing old value blocks indirect update' '
EOF
printf "%s\n" "update $prefix/symref $E $D" |
test_must_fail git update-ref --stdin 2>output.err &&
- test_cmp expected output.err
+ if test_have_prereq REFFILES ; then
+ test_cmp expected output.err
+ fi
'
test_expect_success 'incorrect old value blocks indirect update' '
@@ -392,7 +406,9 @@ test_expect_success 'incorrect old value blocks indirect update' '
EOF
printf "%s\n" "update $prefix/symref $E $D" |
test_must_fail git update-ref --stdin 2>output.err &&
- test_cmp expected output.err
+ if test_have_prereq REFFILES ; then
+ test_cmp expected output.err
+ fi
'
test_expect_success 'existing old value blocks indirect create' '
@@ -404,7 +420,9 @@ test_expect_success 'existing old value blocks indirect create' '
EOF
printf "%s\n" "create $prefix/symref $E" |
test_must_fail git update-ref --stdin 2>output.err &&
- test_cmp expected output.err
+ if test_have_prereq REFFILES ; then
+ test_cmp expected output.err
+ fi
'
test_expect_success 'incorrect old value blocks indirect delete' '
@@ -416,7 +434,9 @@ test_expect_success 'incorrect old value blocks indirect delete' '
EOF
printf "%s\n" "delete $prefix/symref $D" |
test_must_fail git update-ref --stdin 2>output.err &&
- test_cmp expected output.err
+ if test_have_prereq REFFILES ; then
+ test_cmp expected output.err
+ fi
'
test_expect_success 'missing old value blocks indirect no-deref update' '
@@ -427,7 +447,9 @@ test_expect_success 'missing old value blocks indirect no-deref update' '
EOF
printf "%s\n" "option no-deref" "update $prefix/symref $E $D" |
test_must_fail git update-ref --stdin 2>output.err &&
- test_cmp expected output.err
+ if test_have_prereq REFFILES ; then
+ test_cmp expected output.err
+ fi
'
test_expect_success 'incorrect old value blocks indirect no-deref update' '
@@ -439,7 +461,9 @@ test_expect_success 'incorrect old value blocks indirect no-deref update' '
EOF
printf "%s\n" "option no-deref" "update $prefix/symref $E $D" |
test_must_fail git update-ref --stdin 2>output.err &&
- test_cmp expected output.err
+ if test_have_prereq REFFILES ; then
+ test_cmp expected output.err
+ fi
'
test_expect_success 'existing old value blocks indirect no-deref create' '
@@ -451,7 +475,9 @@ test_expect_success 'existing old value blocks indirect no-deref create' '
EOF
printf "%s\n" "option no-deref" "create $prefix/symref $E" |
test_must_fail git update-ref --stdin 2>output.err &&
- test_cmp expected output.err
+ if test_have_prereq REFFILES ; then
+ test_cmp expected output.err
+ fi
'
test_expect_success 'incorrect old value blocks indirect no-deref delete' '
@@ -463,7 +489,9 @@ test_expect_success 'incorrect old value blocks indirect no-deref delete' '
EOF
printf "%s\n" "option no-deref" "delete $prefix/symref $D" |
test_must_fail git update-ref --stdin 2>output.err &&
- test_cmp expected output.err
+ if test_have_prereq REFFILES ; then
+ test_cmp expected output.err
+ fi
'
test_expect_success REFFILES 'non-empty directory blocks create' '