diff options
author | Junio C Hamano <gitster@pobox.com> | 2014-04-09 21:01:28 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-04-09 21:01:28 +0200 |
commit | aba7af8e67664f60b432ae1760644f9e96470949 (patch) | |
tree | b0e8f3ca4c167b4935d8a047fcff54efa65f125d /t | |
parent | Merge branch 'jk/commit-dates-parsing-fix' into maint (diff) | |
parent | update-ref: fail create operation over stdin if ref already exists (diff) | |
download | git-aba7af8e67664f60b432ae1760644f9e96470949.tar.xz git-aba7af8e67664f60b432ae1760644f9e96470949.zip |
Merge branch 'mh/update-ref-batch-create-fix' into maint
* mh/update-ref-batch-create-fix:
update-ref: fail create operation over stdin if ref already exists
Diffstat (limited to 't')
-rwxr-xr-x | t/t1400-update-ref.sh | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/t/t1400-update-ref.sh b/t/t1400-update-ref.sh index 6ffd82fe32..e130c528fe 100755 --- a/t/t1400-update-ref.sh +++ b/t/t1400-update-ref.sh @@ -820,7 +820,18 @@ test_expect_success 'stdin -z update ref fails with bad old value' ' test_must_fail git rev-parse --verify -q $c ' +test_expect_success 'stdin -z create ref fails when ref exists' ' + git update-ref $c $m && + git rev-parse "$c" >expect && + printf $F "create $c" "$m~1" >stdin && + test_must_fail git update-ref -z --stdin <stdin 2>err && + grep "fatal: Cannot lock the ref '"'"'$c'"'"'" err && + git rev-parse "$c" >actual && + test_cmp expect actual +' + test_expect_success 'stdin -z create ref fails with bad new value' ' + git update-ref -d "$c" && 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 && |