aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2008-05-31 23:58:05 -0400
committerJunio C Hamano <gitster@pobox.com>2008-05-31 23:55:15 -0700
commitc175a7ad32ee978baaa6524304e9406684bd1286 (patch)
treef4dfac9616a1d0118864aff474b56713eeadfdf3 /t
parent6a15bc0d220cf3b139d80326afa0d70411916aed (diff)
downloadgit-c175a7ad32ee978baaa6524304e9406684bd1286.tar.gz
git-c175a7ad32ee978baaa6524304e9406684bd1286.tar.xz
Make "git-remote prune" delete refs according to fetch specs
A remote may be configured to fetch into tracking branches that do not match the remote name. For example a user may have created extra remotes that will fetch to the same tracking branch namespace, but from different URLs: [remote "origin"] url = git://git.kernel.org/pub/scm/git/git.git fetch = refs/heads/*:refs/remotes/origin/* [remote "alt"] url = git://repo.or.cz/alt-git.git fetch = refs/heads/*:refs/remotes/origin/* When running `git remote prune alt` we expect stale branches to be removed from "refs/remotes/origin/*" and not from the unused namespace of "refs/remotes/alt/*". Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-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 a37b6f521..0d7ed1f99 100755
--- a/t/t5505-remote.sh
+++ b/t/t5505-remote.sh
@@ -164,6 +164,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