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>
Johannes Schindelin committed
Feb 29, 2008 at 01:45 UTC
4704640b611dfb275f6a74c9a9be5e309260a71c
1 file changed
+34
t/t5505-remote.sh
+34
@@ -94,4 +94,38 @@ test_expect_success 'remove remote' '
94
)
95
'
96
97
+cat > test/expect << EOF
98
+* remote origin
99
+ URL: $(pwd)/one/.git
100
+ Remote branch(es) merged with 'git pull' while on branch master
101
+ master
102
+ New remote branches (next fetch will store in remotes/origin)
103
+ master
104
+ Tracked remote branches
105
+ side master
106
+EOF
107
+
108
+test_expect_success 'show' '
109
+ (cd test &&
110
+ git config --add remote.origin.fetch \
111
+ refs/heads/master:refs/heads/upstream &&
112
+ git fetch &&
113
+ git branch -d -r origin/master &&
114
+ (cd ../one &&
115
+ echo 1 > file &&
116
+ git commit -m update file) &&
117
+ git remote show origin > output &&
118
+ git diff expect output)
119
+'
120
+
121
+test_expect_success 'prune' '
122
+ (cd one &&
123
+ git branch -m side side2) &&
124
+ (cd test &&
125
+ git fetch origin &&
126
+ git remote prune origin &&
127
+ git rev-parse refs/remotes/origin/side2 &&
128
+ ! git rev-parse refs/remotes/origin/side)
129
+'
130
+
131
test_done