diff mbox series

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

Message ID 20200929155350.49066-4-andrew@adoakley.name (mailing list archive)
State New, archived
Headers show
Series Submodules and partial clones | expand

Commit Message

Andrew Oakley Sept. 29, 2020, 3:53 p.m. UTC
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 mbox series

Patch

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