X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft5517-push-mirror.sh;h=ea49dedbf8867694d83cd550c8212ff107361920;hb=7dde4bb3674da53dd9e33c741bea3fe680690a0d;hp=ed3fec192a8da73da269af03746fa7e9eda65d52;hpb=4698ef555a1706fe322a68a02a21fb1087940ac3;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