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

[PATCH 2/4] t5329: test 'git gc --cruft' without '--prune=now'

From
Derrick Stolee via GitGitGadget <gitgitgadget@gmail.com>
Date
Jun 14, 2022, 21:27 UTC
Message-ID
<f59a0c326a01ab5f4e415a7ed03ff046b84b337b.1655242070.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.1261.git.1655242070.gitgitgadget@gmail.com>
From: Derrick Stolee <derrickstolee@github.com>

Replace a 'git repack --cruft -d' with the wrapper 'git gc --cruft' to exercise some logic in builtin/gc.c that adds the '--cruft' option to the underlying 'git repack' command.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
---
 t/t5329-pack-objects-cruft.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/t/t5329-pack-objects-cruft.sh b/t/t5329-pack-objects-cruft.sh
index b481224b93d..55bb9c0e7b5 100755
--- a/t/t5329-pack-objects-cruft.sh
+++ b/t/t5329-pack-objects-cruft.sh
@@ -451,11 +451,13 @@ test_expect_success 'expiring cruft objects with git gc' '
 		sort <reachable.raw >reachable &&
 		comm -13 reachable objects >unreachable &&
 
-		git repack --cruft -d &&
+		# Write a cruft pack instead of deleting files.
+		git gc --cruft &&
 
 		mtimes=$(ls .git/objects/pack/pack-*.mtimes) &&
 		test_path_is_file $mtimes &&
 
+		# Ignore the cruft pack and delete every unreachable object.
 		git gc --cruft --prune=now &&
 
 		git cat-file --batch-all-objects --batch-check="%(objectname)" >objects &&
-- 
gitgitgadget
Previous: Derrick StoleeNext: Taylor Blau
Message 5 of 15 in “Reactions to v2.37.0-rc0 test coverage report”
  1. 0/4 Reactions to v2.37.0-rc0 test coverage reportDerrick Stolee via GitGitGadget, Jun 14, 2022
  2. 1/4 t2107: test 'git update-index --verbose'Derrick Stolee via GitGitGadget, Jun 14, 2022
  3. Eric SunshineJun 15, 2022
  4. Derrick StoleeJun 16, 2022
  5. 2/4 t5329: test 'git gc --cruft' without '--prune=now'Derrick Stolee via GitGitGadget, Jun 14, 2022
  6. Taylor BlauJun 14, 2022
  7. Derrick StoleeJun 15, 2022
  8. 3/4 pack-write: drop always-NULL parameterDerrick Stolee via GitGitGadget, Jun 14, 2022
  9. 4/4 cache-tree: remove cache_tree_find_path()Derrick Stolee via GitGitGadget, Jun 14, 2022
  10. 0/4 Reactions to v2.37.0-rc0 test coverage reportDerrick Stolee via GitGitGadget, Jun 16, 2022
  11. 1/4 t2107: test 'git update-index --verbose'Derrick Stolee via GitGitGadget, Jun 16, 2022
  12. 2/4 t5329: test 'git gc --cruft' without '--prune=now'Derrick Stolee via GitGitGadget, Jun 16, 2022
  13. 3/4 pack-write: drop always-NULL parameterDerrick Stolee via GitGitGadget, Jun 16, 2022
  14. 4/4 cache-tree: remove cache_tree_find_path()Derrick Stolee via GitGitGadget, Jun 16, 2022
  15. Junio C HamanoJun 16, 2022

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.