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

[PATCH 3/7] Add failing test for partial clones with submodules

From
Andrew Oakley <andrew@adoakley.name>
Date
Sep 29, 2020, 15:53 UTC
Message-ID
<20200929155350.49066-4-andrew@adoakley.name>
In-Reply-To
<20200929155350.49066-1-andrew@adoakley.name>
From: Luke Diamand <luke@diamand.org>

When using a partial clone with submodules, the initial clone works fine, but subsequent updates fail with:

    fatal: git upload-pack: not our ref 5d54256650497d43cbeedc86648d6f16eaf556d2
    fatal: remote error: upload-pack: not our ref 5d54256650497d43cbeedc86648d6f16eaf556d2
Signed-off-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Andrew Oakley <andrew@adoakley.name>
---
 t/t0411-partial-clone-submodules.sh | 44 +++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)
 create mode 100755 t/t0411-partial-clone-submodules.sh
diff --git a/t/t0411-partial-clone-submodules.sh b/t/t0411-partial-clone-submodules.sh
new file mode 100755
index 0000000000..e8fdcc4670
--- /dev/null
+++ b/t/t0411-partial-clone-submodules.sh
@@ -0,0 +1,44 @@
+#!/bin/sh
+
+test_description='partial clone with submodules'
+
+. ./test-lib.sh
+
+test_expect_success 'partial clone setup' '
+	test_create_repo super &&
+    test_create_repo submod &&
+
+	git -C super config uploadpack.allowfilter true &&
+	git -C super config uploadpack.allowanysha1inwant true &&
+
+    generate_zero_bytes 1024 >submod/bigfile &&
+    generate_zero_bytes 1 >submod/smallfile &&
+    git -C submod add bigfile smallfile &&
+    git -C submod commit -m "Adding files" &&
+    git -C super submodule add ../submod ./submod &&
+    git -C super commit -m "Adding submodule" &&
+    generate_zero_bytes 1025 >submod/bigfile &&
+    git -C submod commit -m "Extend bigfile" bigfile &&
+    git -C super submodule update --rebase --remote &&
+    git -C super add submod &&
+    git -C super commit -m "Extend bigfile"
+'
+
+test_expect_success 'partial clone of super' '
+    git clone --recursive --filter=blob:limit=512 "file://$(pwd)/super" cloned-super &&
+    test_path_exists cloned-super/submod/bigfile
+'
+
+test_expect_success 'update submodule' '
+    generate_zero_bytes 1026 >submod/bigfile &&
+    git -C submod commit -m "Further extend bigfile" bigfile &&
+    git -C super submodule update --rebase --remote &&
+    git -C super add submod &&
+    git -C super commit -m "Further extend bigfile"
+'
+
+test_expect_success 'update partial clone' '
+    git -C cloned-super pull --recurse-submodules --rebase
+'
+
+test_done
-- 
2.26.2
Previous: Andrew OakleyNext: Andrew Oakley
Message 4 of 11 in “Submodules and partial clones”
  1. 0/7 Submodules and partial clonesAndrew Oakley, Sep 29, 2020
  2. 6/7 submodule: remove add_submodule_odbAndrew Oakley, Sep 29, 2020
  3. 2/7 submodule: use separate submodule repositoriesAndrew Oakley, Sep 29, 2020
  4. 3/7 Add failing test for partial clones with submodulesAndrew Oakley, Sep 29, 2020
  5. 4/7 refs: use correct repo in refs_peel_refAndrew Oakley, Sep 29, 2020
  6. 1/7 refs: store owning repository for object lookupAndrew Oakley, Sep 29, 2020
  7. 7/7 submodule: use partial clone filterAndrew Oakley, Sep 29, 2020
  8. 5/7 merge-recursive: use separate submodule repositoryAndrew Oakley, Sep 29, 2020
  9. Jonathan TanSep 29, 2020
  10. Andrew OakleySep 30, 2020
  11. Jonathan TanSep 30, 2020

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.