git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Shawn O. Pearce <spearce@spearce.org>
Date
Jun 1, 2008, 04:40 UTC
Message-ID
<20080601044047.GF12896@spearce.org>
In-Reply-To
<20080601042804.GA32293@spearce.org>
"Shawn O. Pearce" <spearce@spearce.org> 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.
Previous: Shawn O. PearceNext: Junio C Hamano
Message 3 of 7 in “Make "git-remote rm" delete refs acccording to fetch specs”
  1. 3/3 Make "git-remote rm" delete refs acccording to fetch specsShawn O. Pearce, Jun 1, 2008
  2. 3/3 Make "git-remote rm" delete refs acccording to fetch specsShawn O. Pearce, Jun 1, 2008
  3. Shawn O. PearceJun 1, 2008
  4. Junio C HamanoJun 1, 2008
  5. Shawn O. PearceJun 1, 2008
  6. Junio C HamanoJun 1, 2008
  7. Jon LoeligerJun 2, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.