aboutsummaryrefslogtreecommitdiffstats
path: root/t/t5510-fetch.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/t5510-fetch.sh')
-rwxr-xr-xt/t5510-fetch.sh46
1 files changed, 46 insertions, 0 deletions
diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh
index 08dbea6503..6b2739db26 100755
--- a/t/t5510-fetch.sh
+++ b/t/t5510-fetch.sh
@@ -59,6 +59,12 @@ test_expect_success "clone and setup child repos" '
cd case_sensitive_fd &&
git branch foo/bar &&
git branch Foo
+ ) &&
+ git clone --ref-format=reftable . case_sensitive_df &&
+ (
+ cd case_sensitive_df &&
+ git branch Foo/bar &&
+ git branch foo
)
'
@@ -1592,6 +1598,46 @@ test_expect_success CASE_INSENSITIVE_FS,REFFILES 'F/D conflict on case insensiti
)
'
+test_expect_success CASE_INSENSITIVE_FS,REFFILES 'D/F conflict on case insensitive filesystem' '
+ test_when_finished rm -rf case_insensitive &&
+ (
+ git init --bare case_insensitive &&
+ cd case_insensitive &&
+ git remote add origin -- ../case_sensitive_df &&
+ test_must_fail git fetch -f origin "refs/heads/*:refs/heads/*" 2>err &&
+ test_grep "failed: refname conflict" err &&
+ git rev-parse refs/heads/main >expect &&
+ git rev-parse refs/heads/Foo/bar >actual &&
+ test_cmp expect actual
+ )
+'
+
+test_expect_success REFFILES 'D/F conflict on case sensitive filesystem with lock' '
+ (
+ git init --ref-format=reftable base &&
+ cd base &&
+ echo >file update &&
+ git add . &&
+ git commit -m "updated" &&
+ git branch -M main &&
+
+ git update-ref refs/heads/foo @ &&
+ git update-ref refs/heads/branch @ &&
+ cd .. &&
+
+ git init --ref-format=files --bare repo &&
+ cd repo &&
+ git remote add origin ../base &&
+ mkdir refs/heads/foo &&
+ touch refs/heads/foo/random.lock &&
+ test_must_fail git fetch origin "refs/heads/*:refs/heads/*" 2>err &&
+ test_grep "some local refs could not be updated; try running" err &&
+ git rev-parse refs/heads/main >expect &&
+ git rev-parse refs/heads/branch >actual &&
+ test_cmp expect actual
+ )
+'
+
. "$TEST_DIRECTORY"/lib-httpd.sh
start_httpd