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

[PATCH v2 5/5] t5710: add testcase for multi-level relative alternates

From
WHWang Hui <hui.wang@windriver.com>
Date
Sep 6, 2011, 10:24 UTC
Message-ID
<1315304645-12009-6-git-send-email-Hui.Wang@windriver.com>
In-Reply-To
<1315304645-12009-5-git-send-email-Hui.Wang@windriver.com>
From: Hui Wang <Hui.Wang@windriver.com>

Since we removed "relative alternates only possible for current dir" limitation, it is needed to change an existing testcase to make it pass for the relative path at the second level alternates.

Add a new testcase to make it pass when it work at a 5-level relative alternates repository and make it fail when it work at a 6-level relative alternates repository.

Signed-off-by: Hui Wang <Hui.Wang@windriver.com>
---
 t/t5710-info-alternate.sh |   21 +++++++++++++++++++--
 1 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/t/t5710-info-alternate.sh b/t/t5710-info-alternate.sh
index ef7127c..a606a94 100755
--- a/t/t5710-info-alternate.sh
+++ b/t/t5710-info-alternate.sh
@@ -102,9 +102,26 @@ test_valid_repo'
 cd "$base_dir"
 
 test_expect_success \
-    'that relative alternate is only possible for current dir' '
+    'that relative alternate is possible for none current dir' '
     cd D &&
-    ! (test_valid_repo)
+    test_valid_repo
+'
+
+cd "$base_dir"
+
+test_expect_success 'allow maxium 5 level relative alternate' \
+'echo "" > A/.git/objects/info/alternates &&
+echo "../../../A/.git/objects" > B/.git/objects/info/alternates &&
+echo "../../../B/.git/objects" > C/.git/objects/info/alternates &&
+echo "../../../C/.git/objects" > D/.git/objects/info/alternates &&
+echo "../../../D/.git/objects" > E/.git/objects/info/alternates &&
+echo "../../../E/.git/objects" > F/.git/objects/info/alternates &&
+echo "../../../F/.git/objects" > G/.git/objects/info/alternates &&
+cd F &&
+test_valid_repo &&
+cd ../G &&
+git fsck --full > fsck.err 2>&1 &&
+test `wc -l < fsck.err` != 0
 '
 
 cd "$base_dir"
-- 
1.6.3.1
Previous: Wang HuiNext: Junio C Hamano
Message 6 of 11 in “sha1_file: remove only current repository can have relative path limitation”
  1. 0/5 sha1_file: remove only current repository can have relative path limitationWang Hui, Sep 6, 2011
  2. 1/5 sha1_file cleanup: remove redundant variable checkWang Hui, Sep 6, 2011
  3. 2/5 sha1_file: remove a buggy value settingWang Hui, Sep 6, 2011
  4. 3/5 sha1_file: improve directories comparison methodWang Hui, Sep 6, 2011
  5. 4/5 sha1_file: remove relative entries limitationWang Hui, Sep 6, 2011
  6. 5/5 t5710: add testcase for multi-level relative alternatesWang Hui, Sep 6, 2011
  7. Junio C HamanoSep 6, 2011
  8. Junio C HamanoSep 6, 2011
  9. wanghuiSep 7, 2011
  10. Junio C HamanoSep 6, 2011
  11. wanghuiSep 7, 2011

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.