aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2026-03-04 10:52:59 -0800
committerJunio C Hamano <gitster@pobox.com>2026-03-04 10:52:59 -0800
commitfa383b96c7211a415152dffaf6b272bb09116f06 (patch)
treed0bafbc0b0e2b8843b1b4d942922c6ccbf49f6df /t
parent22c9b6bd93ef8975deebd2a4439aa428ab22118b (diff)
parent3ef68ff40ebf75bba9c4b05f50197190ff1abda2 (diff)
downloadgit-fa383b96c7211a415152dffaf6b272bb09116f06.tar.xz
Merge branch 'sp/shallow-deepen-relative-fix'
"git fetch --deepen" that tries to go beyond merged branch used to get confused where the updated shallow points are, which has been corrected. * sp/shallow-deepen-relative-fix: shallow: handling fetch relative-deepen shallow: free local object_array allocations
Diffstat (limited to 't')
-rwxr-xr-xt/t5500-fetch-pack.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh
index 4bb56c167a..c0278ef732 100755
--- a/t/t5500-fetch-pack.sh
+++ b/t/t5500-fetch-pack.sh
@@ -960,6 +960,29 @@ test_expect_success 'fetching deepen' '
)
'
+test_expect_success 'fetching deepen beyond merged branch' '
+ test_create_repo shallow-deepen-merged &&
+ (
+ cd shallow-deepen-merged &&
+ git commit --allow-empty -m one &&
+ git commit --allow-empty -m two &&
+ git commit --allow-empty -m three &&
+ git switch -c branch &&
+ git commit --allow-empty -m four &&
+ git commit --allow-empty -m five &&
+ git switch main &&
+ git merge --no-ff branch &&
+ cd - &&
+ git clone --bare --depth 3 "file://$(pwd)/shallow-deepen-merged" deepen.git &&
+ git -C deepen.git fetch origin --deepen=1 &&
+ git -C deepen.git rev-list --all >actual &&
+ for commit in $(sed "/^$/d" deepen.git/shallow)
+ do
+ test_grep "$commit" actual || exit 1
+ done
+ )
+'
+
test_negotiation_algorithm_default () {
test_when_finished rm -rf clientv0 clientv2 &&
rm -rf server client &&