X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft5517-push-mirror.sh;h=ea49dedbf8867694d83cd550c8212ff107361920;hb=e896912c5edb8f989a2d25e101b2eb14f1a56aa9;hp=ed3fec192a8da73da269af03746fa7e9eda65d52;hpb=67cdec1e58f1f9bc17d500b04e856042e0b2bf59;p=git.git diff --git a/t/t5517-push-mirror.sh b/t/t5517-push-mirror.sh index ed3fec192..ea49dedbf 100755 --- a/t/t5517-push-mirror.sh +++ b/t/t5517-push-mirror.sh @@ -25,7 +25,7 @@ mk_repo_pair () { ( cd master && git init && - git config remote.up.url ../mirror + git remote add $1 up ../mirror ) } @@ -225,4 +225,43 @@ test_expect_success 'push mirror adds, updates and removes tags together' ' ' +test_expect_success 'remote.foo.mirror adds and removes branches' ' + + mk_repo_pair --mirror && + ( + cd master && + echo one >foo && git add foo && git commit -m one && + git branch keep master && + git branch remove master && + git push up && + git branch -D remove + git push up + ) && + ( + cd mirror && + git show-ref -s --verify refs/heads/keep && + invert git show-ref -s --verify refs/heads/remove + ) + +' + +test_expect_success 'remote.foo.mirror=no has no effect' ' + + mk_repo_pair && + ( + cd master && + echo one >foo && git add foo && git commit -m one && + git config --add remote.up.mirror no && + git branch keep master && + git push --mirror up && + git branch -D keep && + git push up + ) && + ( + cd mirror && + git show-ref -s --verify refs/heads/keep + ) + +' + test_done