diff options
author | Junio C Hamano <gitster@pobox.com> | 2018-11-21 22:57:46 +0900 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-11-21 22:57:46 +0900 |
commit | 50e6df214d7f75559e4ad90c2fd1d8fc36938c8c (patch) | |
tree | e5e3e49ddf4b2442c1b3f6ca3a45c915b39dd63b /t/t1400-update-ref.sh | |
parent | Merge branch 'ms/remote-error-message-update' into maint (diff) | |
parent | update-ref: allow --no-deref with --stdin (diff) | |
download | tgif-50e6df214d7f75559e4ad90c2fd1d8fc36938c8c.tar.xz |
Merge branch 'en/update-ref-no-deref-stdin' into maint
"git update-ref" learned to make both "--no-deref" and "--stdin"
work at the same time.
* en/update-ref-no-deref-stdin:
update-ref: allow --no-deref with --stdin
update-ref: fix type of update_flags variable to match its usage
Diffstat (limited to 't/t1400-update-ref.sh')
-rwxr-xr-x | t/t1400-update-ref.sh | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/t/t1400-update-ref.sh b/t/t1400-update-ref.sh index 7c8df20955..02493f14ba 100755 --- a/t/t1400-update-ref.sh +++ b/t/t1400-update-ref.sh @@ -807,6 +807,37 @@ test_expect_success 'stdin delete symref works option no-deref' ' test_cmp expect actual ' +test_expect_success 'stdin update symref works flag --no-deref' ' + git symbolic-ref TESTSYMREFONE $b && + git symbolic-ref TESTSYMREFTWO $b && + cat >stdin <<-EOF && + update TESTSYMREFONE $a $b + update TESTSYMREFTWO $a $b + EOF + git update-ref --no-deref --stdin <stdin && + git rev-parse TESTSYMREFONE TESTSYMREFTWO >expect && + git rev-parse $a $a >actual && + test_cmp expect actual && + git rev-parse $m~1 >expect && + git rev-parse $b >actual && + test_cmp expect actual +' + +test_expect_success 'stdin delete symref works flag --no-deref' ' + git symbolic-ref TESTSYMREFONE $b && + git symbolic-ref TESTSYMREFTWO $b && + cat >stdin <<-EOF && + delete TESTSYMREFONE $b + delete TESTSYMREFTWO $b + EOF + git update-ref --no-deref --stdin <stdin && + test_must_fail git rev-parse --verify -q TESTSYMREFONE && + test_must_fail git rev-parse --verify -q TESTSYMREFTWO && + git rev-parse $m~1 >expect && + git rev-parse $b >actual && + test_cmp expect actual +' + test_expect_success 'stdin delete ref works with right old value' ' echo "delete $b $m~1" >stdin && git update-ref --stdin <stdin && |