summaryrefslogtreecommitdiff
path: root/t/t5505-remote.sh
diff options
context:
space:
mode:
authorOlivier Marin <dkr@freesurf.fr>2008-06-10 16:51:35 +0200
committerJunio C Hamano <gitster@pobox.com>2008-06-10 23:17:41 -0700
commit8d7679276af861b44e307c9879f6c4774f4944fc (patch)
tree3c60781578380ecd638465e57c7dbd32b5ef1cec /t/t5505-remote.sh
parent67a7e2d07162dc470f7e3ae1889aad146e5b7917 (diff)
downloadgit-8d7679276af861b44e307c9879f6c4774f4944fc.tar.gz
remote prune: print the list of pruned branches
This command is really too quiet which make it unconfortable to use. Also implement a --dry-run option, in place of the original -n one, to list stale tracking branches that will be pruned, but do not actually prune them. Add a test case for --dry-run. Signed-off-by: Olivier Marin <dkr@freesurf.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5505-remote.sh')
-rwxr-xr-xt/t5505-remote.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh
index c6a7bfb448..c17d9dcc74 100755
--- a/t/t5505-remote.sh
+++ b/t/t5505-remote.sh
@@ -165,6 +165,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 &&