summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>2008-02-29 01:45:24 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-03-01 09:51:44 (GMT)
commit4704640b611dfb275f6a74c9a9be5e309260a71c (patch)
tree338a6a048e8ea6969ccf88d747450318d882b623
parenta0ec9d25d9f1c1469ec375169557a1c17d486993 (diff)
downloadgit-4704640b611dfb275f6a74c9a9be5e309260a71c.zip
git-4704640b611dfb275f6a74c9a9be5e309260a71c.tar.gz
git-4704640b611dfb275f6a74c9a9be5e309260a71c.tar.bz2
Test "git remote show" and "git remote prune"
While at it, also fix a few instances where a cd was done outside of a subshell. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-xt/t5505-remote.sh34
1 files changed, 34 insertions, 0 deletions
diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh
index 4fc62f5..e1e0a18 100755
--- a/t/t5505-remote.sh
+++ b/t/t5505-remote.sh
@@ -94,4 +94,38 @@ test_expect_success 'remove remote' '
)
'
+cat > test/expect << EOF
+* remote origin
+ URL: $(pwd)/one/.git
+ Remote branch(es) merged with 'git pull' while on branch master
+ master
+ New remote branches (next fetch will store in remotes/origin)
+ master
+ Tracked remote branches
+ side master
+EOF
+
+test_expect_success 'show' '
+ (cd test &&
+ git config --add remote.origin.fetch \
+ refs/heads/master:refs/heads/upstream &&
+ git fetch &&
+ git branch -d -r origin/master &&
+ (cd ../one &&
+ echo 1 > file &&
+ git commit -m update file) &&
+ git remote show origin > output &&
+ git diff expect output)
+'
+
+test_expect_success 'prune' '
+ (cd one &&
+ git branch -m side side2) &&
+ (cd test &&
+ git fetch origin &&
+ git remote prune origin &&
+ git rev-parse refs/remotes/origin/side2 &&
+ ! git rev-parse refs/remotes/origin/side)
+'
+
test_done