aboutsummaryrefslogtreecommitdiff
path: root/t/t1400-update-ref.sh
diff options
context:
space:
mode:
authorMichael Haggerty <mhagger@alum.mit.edu>2014-04-07 15:48:01 +0200
committerJunio C Hamano <gitster@pobox.com>2014-04-07 12:09:12 -0700
commit1746ef4e9d869fb0f54194bb225604eb61a77501 (patch)
tree8754a6752a6793e43a910bf94be96257a933e157 /t/t1400-update-ref.sh
parented410e611dc39dc7e845f27a660b76b7d0ecbab6 (diff)
downloadgit-1746ef4e9d869fb0f54194bb225604eb61a77501.tar.gz
git-1746ef4e9d869fb0f54194bb225604eb61a77501.tar.xz
update-ref --stdin: improve error messages for invalid values
If an invalid value is passed to "update-ref --stdin" as <oldvalue> or <newvalue>, include the command and the name of the reference at the beginning of the error message. Update the tests accordingly. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t1400-update-ref.sh')
-rwxr-xr-xt/t1400-update-ref.sh8
1 files changed, 4 insertions, 4 deletions
diff --git a/t/t1400-update-ref.sh b/t/t1400-update-ref.sh
index 00862bc28..f6c6e960d 100755
--- a/t/t1400-update-ref.sh
+++ b/t/t1400-update-ref.sh
@@ -518,14 +518,14 @@ test_expect_success 'stdin update ref fails with wrong old value' '
test_expect_success 'stdin update ref fails with bad old value' '
echo "update $c $m does-not-exist" >stdin &&
test_must_fail git update-ref --stdin <stdin 2>err &&
- grep "fatal: invalid old value for ref $c: does-not-exist" err &&
+ grep "fatal: update $c: invalid old value: does-not-exist" err &&
test_must_fail git rev-parse --verify -q $c
'
test_expect_success 'stdin create ref fails with bad new value' '
echo "create $c does-not-exist" >stdin &&
test_must_fail git update-ref --stdin <stdin 2>err &&
- grep "fatal: invalid new value for ref $c: does-not-exist" err &&
+ grep "fatal: create $c: invalid new value: does-not-exist" err &&
test_must_fail git rev-parse --verify -q $c
'
@@ -840,14 +840,14 @@ test_expect_success 'stdin -z update ref fails with wrong old value' '
test_expect_success 'stdin -z update ref fails with bad old value' '
printf $F "update $c" "$m" "does-not-exist" >stdin &&
test_must_fail git update-ref -z --stdin <stdin 2>err &&
- grep "fatal: invalid old value for ref $c: does-not-exist" err &&
+ grep "fatal: update $c: invalid old value: does-not-exist" err &&
test_must_fail git rev-parse --verify -q $c
'
test_expect_success 'stdin -z create ref fails with bad new value' '
printf $F "create $c" "does-not-exist" >stdin &&
test_must_fail git update-ref -z --stdin <stdin 2>err &&
- grep "fatal: invalid new value for ref $c: does-not-exist" err &&
+ grep "fatal: create $c: invalid new value: does-not-exist" err &&
test_must_fail git rev-parse --verify -q $c
'