Subject: Re: [PATCH 3/3 v2] Make "git-remote rm" delete refs acccording to fetch specs

From: "Shawn O. Pearce" <[email-masked]>
Date: Sun, 1 Jun 2008 00:40:47 -0400

"Shawn O. Pearce" <[email-masked]> wrote:
> To avoid deleting refs used by another remote we only clear refs
> that are unique to this remote.  This prevents `git prune rm alt`
> from removing the refs used by say origin if alt was just using a
> different URL for the same repository.

Hmm.  You probably should squash this test case into that patch.

--8<--
diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh
index 0d7ed1f..96e461b 100755
--- a/t/t5505-remote.sh
+++ b/t/t5505-remote.sh
@@ -182,6 +182,18 @@ test_expect_success 'add alt && prune' '
 	 git rev-parse --verify refs/remotes/origin/side2)
 '
 
+test_expect_success 'rm alt' '
+	(cd alttst &&
+	 git remote rm alt &&
+	 tokens_match z z$(git config remote.alt.url) &&
+	 tokens_match z z$(git config remote.alt.fetch) &&
+	 git rev-parse --verify refs/remotes/origin/side2 &&
+	 git remote rm origin &&
+	 tokens_match z z$(git config remote.alt.url) &&
+	 tokens_match z z$(git config remote.alt.fetch) &&
+	 ! git rev-parse --verify refs/remotes/origin/side2)
+'
+
 cat > one/expect << EOF
   apis/master
   apis/side

-- 
Shawn.