X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft5505-remote.sh;h=1e192a2207a4b56d477e8e3efc382c3a296ba776;hb=2b2828b452bd8b3258de75451f77362decb1dffe;hp=48ff2d424d1587bde388422da874feb3d55cbf0d;hpb=9c36e1700f99811ea9190279ea197424dcbb0303;p=git.git diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh index 48ff2d424..1e192a220 100755 --- a/t/t5505-remote.sh +++ b/t/t5505-remote.sh @@ -135,7 +135,26 @@ test_expect_success 'show' ' git config --add remote.origin.push \ +refs/tags/lastbackup && git remote show origin > output && - git diff expect output) + test_cmp expect output) +' + +cat > test/expect << EOF +* remote origin + URL: $(pwd)/one/.git + Remote branch merged with 'git pull' while on branch master + master + Tracked remote branches + master side + Local branches pushed with 'git push' + master:upstream +refs/tags/lastbackup +EOF + +test_expect_success 'show -n' ' + (mv one one.unreachable && + cd test && + git remote show -n origin > output && + mv ../one.unreachable ../one && + test_cmp expect output) ' test_expect_success 'prune' ' @@ -148,6 +167,24 @@ test_expect_success 'prune' ' ! git rev-parse refs/remotes/origin/side) ' +cat > test/expect << EOF +Pruning origin +URL: $(pwd)/one/.git + * [would prune] origin/side2 +EOF + +test_expect_success 'prune --dry-run' ' + (cd one && + git branch -m side2 side) && + (cd test && + git remote prune --dry-run origin > output && + git rev-parse refs/remotes/origin/side2 && + ! git rev-parse refs/remotes/origin/side && + (cd ../one && + git branch -m side side2) && + test_cmp expect output) +' + test_expect_success 'add --mirror && prune' ' (mkdir mirror && cd mirror && @@ -164,6 +201,24 @@ test_expect_success 'add --mirror && prune' ' git rev-parse --verify refs/heads/side) ' +test_expect_success 'add alt && prune' ' + (mkdir alttst && + cd alttst && + git init && + git remote add -f origin ../one && + git config remote.alt.url ../one && + git config remote.alt.fetch "+refs/heads/*:refs/remotes/origin/*") && + (cd one && + git branch -m side side2) && + (cd alttst && + git rev-parse --verify refs/remotes/origin/side && + ! git rev-parse --verify refs/remotes/origin/side2 && + git fetch alt && + git remote prune alt && + ! git rev-parse --verify refs/remotes/origin/side && + git rev-parse --verify refs/remotes/origin/side2) +' + cat > one/expect << EOF apis/master apis/side @@ -179,7 +234,7 @@ test_expect_success 'update' ' git remote add apis ../mirror && git remote update && git branch -r > output && - git diff expect output) + test_cmp expect output) ' @@ -206,7 +261,7 @@ test_expect_success 'update with arguments' ' git config remotes.titanus manduca && git remote update phobaeticus titanus && git branch -r > output && - git diff expect output) + test_cmp expect output) ' @@ -229,7 +284,7 @@ test_expect_success 'update default' ' git config remote.drosophila.skipDefaultUpdate true && git remote update default && git branch -r > output && - git diff expect output) + test_cmp expect output) ' @@ -249,7 +304,7 @@ test_expect_success 'update default (overridden, with funny whitespace)' ' git config remotes.default "$(printf "\t drosophila \n")" && git remote update default && git branch -r > output && - git diff expect output) + test_cmp expect output) '