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

[PATCH] (squash) add index-pack with git-dir test

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 21, 2008, 05:03 UTC
Message-ID
<7vzlkyzgiw.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<alpine.LFD.2.00.0810202110380.26244@xanadu.home>

This tries to make sure that the recent fix to d0b92a3 (index-pack: setup git repository, 2008-08-26) does not introduce regression, and protects the fix from getting broken again.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 * And unfortunately the first one fails with the fix and succeeds
   without; the second one succeeds with your fix and fails without.
 t/t5302-pack-index.sh |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/t/t5302-pack-index.sh b/t/t5302-pack-index.sh
index 6424db1..2edab73 100755
--- a/t/t5302-pack-index.sh
+++ b/t/t5302-pack-index.sh
@@ -177,4 +177,24 @@ test_expect_success \
        ".git/objects/pack/pack-${pack1}.pack" 2>&1) &&
      echo "$err" | grep "CRC mismatch"'
 
+test_expect_success 'running index-pack from a subdirectory' '
+    mkdir subdir &&
+    cp test-1-${pack1}.pack subdir/. &&
+    (
+	cd subdir &&
+	git index-pack test-1-${pack1}.pack
+    ) &&
+    test -f subdir/test-1-${pack1}.idx
+'
+
+test_expect_success 'running index-pack in the object store' '
+    rm -f .git/objects/pack/* &&
+    cp test-1-${pack1}.pack .git/objects/pack/pack-${pack1}.pack &&
+    (
+	cd .git/objects/pack
+	git index-pack pack-${pack1}.pack
+    ) &&
+    test -f .git/objects/pack/pack-${pack1}.idx
+'
+
 test_done
-- 
1.6.0.2.588.g31023
Previous: Nicolas PitreNext: Nguyen Thai Ngoc Duy
Message 2 of 11 in “rehabilitate 'git index-pack' inside the object store”
  1. rehabilitate 'git index-pack' inside the object storeNicolas Pitre, Oct 21, 2008
  2. (squash) add index-pack with git-dir testJunio C Hamano, Oct 21, 2008
  3. Nguyen Thai Ngoc DuyOct 21, 2008
  4. Jeff KingOct 21, 2008
  5. Nicolas PitreOct 21, 2008
  6. Johannes SchindelinOct 21, 2008
  7. Jeff KingOct 21, 2008
  8. new plan for cleaning up the worktree mess, was Re: [PATCH] rehabilitate 'git index-pack' inside the object storeJohannes Schindelin, Oct 21, 2008
  9. Nguyen Thai Ngoc DuyOct 28, 2008
  10. Nguyen Thai Ngoc DuyOct 22, 2008
  11. Nguyen Thai Ngoc DuyOct 22, 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.