mirror of
https://github.com/git/git.git
synced 2026-08-03 06:31:08 +00:00
Merge branch 'om/remote-fix'
* om/remote-fix: "remote prune": be quiet when there is nothing to prune remote show: list tracked remote branches with -n remote prune: print the list of pruned branches builtin-remote: split show_or_prune() in two separate functions remote show: fix the -n option
This commit is contained in:
@@ -138,6 +138,25 @@ test_expect_success 'show' '
|
||||
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' '
|
||||
(cd one &&
|
||||
git branch -m side side2) &&
|
||||
@@ -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 &&
|
||||
|
||||
Reference in New Issue
Block a user