diff options
author | Junio C Hamano <gitster@pobox.com> | 2010-01-22 16:08:07 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-01-22 16:08:07 -0800 |
commit | 16735ae0f8a8e2df5e54807fd0a5930eb97dcb7a (patch) | |
tree | e13934ce10cb0c4e2f96540520acaaa7c66ca49d /t | |
parent | 1a545d0b5fa56a7be88fe082cec7847715079a18 (diff) | |
parent | 433f2be139710e2fc7c0693a8411b2773f1a4b38 (diff) | |
download | git-16735ae0f8a8e2df5e54807fd0a5930eb97dcb7a.tar.gz git-16735ae0f8a8e2df5e54807fd0a5930eb97dcb7a.tar.xz |
Merge branch 'il/remote-updates'
* il/remote-updates:
Add git remote set-url
Diffstat (limited to 't')
-rwxr-xr-x | t/t5505-remote.sh | 216 |
1 files changed, 215 insertions, 1 deletions
diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh index 936fe0a1a..a82c5ffa1 100755 --- a/t/t5505-remote.sh +++ b/t/t5505-remote.sh @@ -533,5 +533,219 @@ test_expect_success 'show empty remote' ' ) ' -test_done +test_expect_success 'new remote' ' +( + git remote add someremote foo && + echo foo >expect && + git config --get-all remote.someremote.url >actual && + cmp expect actual +) +' + +test_expect_success 'remote set-url bar' ' +( + git remote set-url someremote bar && + echo bar >expect && + git config --get-all remote.someremote.url >actual && + cmp expect actual +) +' +test_expect_success 'remote set-url baz bar' ' +( + git remote set-url someremote baz bar && + echo baz >expect && + git config --get-all remote.someremote.url >actual && + cmp expect actual +) +' + +test_expect_success 'remote set-url zot bar' ' +( + test_must_fail git remote set-url someremote zot bar && + echo baz >expect && + git config --get-all remote.someremote.url >actual && + cmp expect actual +) +' + +test_expect_success 'remote set-url --push zot baz' ' +( + test_must_fail git remote set-url --push someremote zot baz && + echo "YYY" >expect && + echo baz >>expect && + test_must_fail git config --get-all remote.someremote.pushurl >actual && + echo "YYY" >>actual && + git config --get-all remote.someremote.url >>actual && + cmp expect actual +) +' + +test_expect_success 'remote set-url --push zot' ' +( + git remote set-url --push someremote zot && + echo zot >expect && + echo "YYY" >>expect && + echo baz >>expect && + git config --get-all remote.someremote.pushurl >actual && + echo "YYY" >>actual && + git config --get-all remote.someremote.url >>actual && + cmp expect actual +) +' + +test_expect_success 'remote set-url --push qux zot' ' +( + git remote set-url --push someremote qux zot && + echo qux >expect && + echo "YYY" >>expect && + echo baz >>expect && + git config --get-all remote.someremote.pushurl >actual && + echo "YYY" >>actual && + git config --get-all remote.someremote.url >>actual && + cmp expect actual +) +' + +test_expect_success 'remote set-url --push foo qu+x' ' +( + git remote set-url --push someremote foo qu+x && + echo foo >expect && + echo "YYY" >>expect && + echo baz >>expect && + git config --get-all remote.someremote.pushurl >actual && + echo "YYY" >>actual && + git config --get-all remote.someremote.url >>actual && + cmp expect actual +) +' + +test_expect_success 'remote set-url --push --add aaa' ' +( + git remote set-url --push --add someremote aaa && + echo foo >expect && + echo aaa >>expect && + echo "YYY" >>expect && + echo baz >>expect && + git config --get-all remote.someremote.pushurl >actual && + echo "YYY" >>actual && + git config --get-all remote.someremote.url >>actual && + cmp expect actual +) +' + +test_expect_success 'remote set-url --push bar aaa' ' +( + git remote set-url --push someremote bar aaa && + echo foo >expect && + echo bar >>expect && + echo "YYY" >>expect && + echo baz >>expect && + git config --get-all remote.someremote.pushurl >actual && + echo "YYY" >>actual && + git config --get-all remote.someremote.url >>actual && + cmp expect actual +) +' + +test_expect_success 'remote set-url --push --delete bar' ' +( + git remote set-url --push --delete someremote bar && + echo foo >expect && + echo "YYY" >>expect && + echo baz >>expect && + git config --get-all remote.someremote.pushurl >actual && + echo "YYY" >>actual && + git config --get-all remote.someremote.url >>actual && + cmp expect actual +) +' + +test_expect_success 'remote set-url --push --delete foo' ' +( + git remote set-url --push --delete someremote foo && + echo "YYY" >expect && + echo baz >>expect && + test_must_fail git config --get-all remote.someremote.pushurl >actual && + echo "YYY" >>actual && + git config --get-all remote.someremote.url >>actual && + cmp expect actual +) +' + +test_expect_success 'remote set-url --add bbb' ' +( + git remote set-url --add someremote bbb && + echo "YYY" >expect && + echo baz >>expect && + echo bbb >>expect && + test_must_fail git config --get-all remote.someremote.pushurl >actual && + echo "YYY" >>actual && + git config --get-all remote.someremote.url >>actual && + cmp expect actual +) +' + +test_expect_success 'remote set-url --delete .*' ' +( + test_must_fail git remote set-url --delete someremote .* && + echo "YYY" >expect && + echo baz >>expect && + echo bbb >>expect && + test_must_fail git config --get-all remote.someremote.pushurl >actual && + echo "YYY" >>actual && + git config --get-all remote.someremote.url >>actual && + cmp expect actual +) +' + +test_expect_success 'remote set-url --delete bbb' ' +( + git remote set-url --delete someremote bbb && + echo "YYY" >expect && + echo baz >>expect && + test_must_fail git config --get-all remote.someremote.pushurl >actual && + echo "YYY" >>actual && + git config --get-all remote.someremote.url >>actual && + cmp expect actual +) +' + +test_expect_success 'remote set-url --delete baz' ' +( + test_must_fail git remote set-url --delete someremote baz && + echo "YYY" >expect && + echo baz >>expect && + test_must_fail git config --get-all remote.someremote.pushurl >actual && + echo "YYY" >>actual && + git config --get-all remote.someremote.url >>actual && + cmp expect actual +) +' + +test_expect_success 'remote set-url --add ccc' ' +( + git remote set-url --add someremote ccc && + echo "YYY" >expect && + echo baz >>expect && + echo ccc >>expect && + test_must_fail git config --get-all remote.someremote.pushurl >actual && + echo "YYY" >>actual && + git config --get-all remote.someremote.url >>actual && + cmp expect actual +) +' + +test_expect_success 'remote set-url --delete baz' ' +( + git remote set-url --delete someremote baz && + echo "YYY" >expect && + echo ccc >>expect && + test_must_fail git config --get-all remote.someremote.pushurl >actual && + echo "YYY" >>actual && + git config --get-all remote.someremote.url >>actual && + cmp expect actual +) +' + +test_done |