summaryrefslogtreecommitdiffstats
path: root/t/t3050-subprojects-fetch.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-09 13:34:27 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-09 13:34:27 +0000
commit4dbdc42d9e7c3968ff7f690d00680419c9b8cb0f (patch)
tree47c1d492e9c956c1cd2b74dbd3b9d8b0db44dc4e /t/t3050-subprojects-fetch.sh
parentInitial commit. (diff)
downloadgit-4dbdc42d9e7c3968ff7f690d00680419c9b8cb0f.tar.xz
git-4dbdc42d9e7c3968ff7f690d00680419c9b8cb0f.zip
Adding upstream version 1:2.43.0.upstream/1%2.43.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 't/t3050-subprojects-fetch.sh')
-rwxr-xr-xt/t3050-subprojects-fetch.sh53
1 files changed, 53 insertions, 0 deletions
diff --git a/t/t3050-subprojects-fetch.sh b/t/t3050-subprojects-fetch.sh
new file mode 100755
index 0000000..3884694
--- /dev/null
+++ b/t/t3050-subprojects-fetch.sh
@@ -0,0 +1,53 @@
+#!/bin/sh
+
+test_description='fetching and pushing project with subproject'
+
+TEST_PASSES_SANITIZE_LEAK=true
+. ./test-lib.sh
+
+test_expect_success setup '
+ test_tick &&
+ mkdir -p sub && (
+ cd sub &&
+ git init &&
+ >subfile &&
+ git add subfile &&
+ git commit -m "subproject commit #1"
+ ) &&
+ >mainfile &&
+ git add sub mainfile &&
+ test_tick &&
+ git commit -m "superproject commit #1"
+'
+
+test_expect_success clone '
+ git clone "file://$(pwd)/.git" cloned &&
+ (git rev-parse HEAD && git ls-files -s) >expected &&
+ (
+ cd cloned &&
+ (git rev-parse HEAD && git ls-files -s) >../actual
+ ) &&
+ test_cmp expected actual
+'
+
+test_expect_success advance '
+ echo more >mainfile &&
+ git update-index --force-remove sub &&
+ mv sub/.git sub/.git-disabled &&
+ git add sub/subfile mainfile &&
+ mv sub/.git-disabled sub/.git &&
+ test_tick &&
+ git commit -m "superproject commit #2"
+'
+
+test_expect_success fetch '
+ (git rev-parse HEAD && git ls-files -s) >expected &&
+ (
+ cd cloned &&
+ git pull &&
+ (git rev-parse HEAD && git ls-files -s) >../actual
+ ) &&
+ test_cmp expected actual
+'
+
+test_done