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

Re: [PATCH] git-send-pack: Fix --all option when used with directory

From
Jeff King <peff@peff.net>
Date
Mar 23, 2016, 21:30 UTC
Message-ID
<20160323213034.GB19920@sigill.intra.peff.net>
In-Reply-To
<20160323212213.GA19920@sigill.intra.peff.net>
On Wed, Mar 23, 2016 at 05:22:13PM -0400, Jeff King wrote:
Show 15 quoted lines
> > diff --git a/t/t9904-send-pack-all.sh b/t/t9904-send-pack-all.sh
> 
> The tests are roughly grouped by functionality. send-pack tests are in
> the t540x range, and this should probably go there. Though I also
> suspect it could easily be added to the end of an existing test script,
> which is preferable.
> 
> > +test_expect_success setup '
> 
> This setup seems a bit more complicated than it needs to be. It's nice
> to keep tests as simple as possible, so a reader can understand exactly
> what is being tested.
> 
> Here are a few things I think we can simplify:
> [...]
So I think we could replace your t9904 with something like this:
diff --git a/t/t5400-send-pack.sh b/t/t5400-send-pack.sh
index 04cea97..305ca7a 100755
--- a/t/t5400-send-pack.sh
+++ b/t/t5400-send-pack.sh
@@ -128,6 +128,18 @@ test_expect_success 'denyNonFastforwards trumps --force' '
 	test "$victim_orig" = "$victim_head"
 '
 
+test_expect_success 'send-pack --all sends all branches' '
+	# make sure we have at least 2 branches with different
+	# values, just to be thorough
+	git branch other-branch HEAD^ &&
+
+	git init --bare all.git &&
+	git send-pack --all all.git &&
+	git for-each-ref refs/heads >expect &&
+	git -C all.git for-each-ref refs/heads >actual &&
+	test_cmp expect actual
+'
+
 test_expect_success 'push --all excludes remote-tracking hierarchy' '
 	mkdir parent &&
 	(
Previous: Jeff KingNext: Stanislav Kolotinskiy
Message 3 of 10 in “git-send-pack: Fix --all option when used with directory”
  1. git-send-pack: Fix --all option when used with directoryStanislav Kolotinskiy, Mar 23, 2016
  2. Jeff KingMar 23, 2016
  3. Jeff KingMar 23, 2016
  4. Stanislav KolotinskiyMar 24, 2016
  5. Jeff KingMar 24, 2016
  6. Stanislav KolotinskiyMar 24, 2016
  7. Junio C HamanoMar 24, 2016
  8. Stanislav KolotinskiyMar 24, 2016
  9. Jeff KingMar 24, 2016
  10. Stanislav KolotinskiyApr 1, 2016

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.