#!/bin/sh global test_description := ''git-merge with case-changing rename on case-insensitive file system'' source ./test-lib.sh if ! test_have_prereq CASE_INSENSITIVE_FS { global skip_all := ''skipping case insensitive tests - case sensitive file system'' test_done } test_expect_success 'merge with case-changing rename' ' test $(git config core.ignorecase) = true && >TestCase && git add TestCase && git commit -m "add TestCase" && git tag baseline && git checkout -b with-camel && >foo && git add foo && git commit -m "intervening commit" && git checkout master && git rm TestCase && >testcase && git add testcase && git commit -m "rename to testcase" && git checkout with-camel && git merge master -m "merge" && test_path_is_file testcase ' test_expect_success 'merge with case-changing rename on both sides' ' git checkout master && git reset --hard baseline && git branch -D with-camel && git checkout -b with-camel && git mv TestCase testcase && git commit -m "recase on branch" && >foo && git add foo && git commit -m "intervening commit" && git checkout master && git rm TestCase && >testcase && git add testcase && git commit -m "rename to testcase" && git checkout with-camel && git merge master -m "merge" && test_path_is_file testcase ' test_done (CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:test_description) op: Equal rhs: {(SQ <"git-merge with case-changing rename on case-insensitive file system">)} spids: [4] ) ] spids: [4] ) (C {(.)} {(./test-lib.sh)}) (If arms: [ (if_arm cond: [(Pipeline children:[(C {(test_have_prereq)} {(CASE_INSENSITIVE_FS)})] negated:True)] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:skip_all) op: Equal rhs: {(SQ <"skipping case insensitive tests - case sensitive file system">)} spids: [26] ) ] spids: [26] ) (C {(test_done)}) ] spids: [-1 23] ) ] spids: [-1 34] ) (C {(test_expect_success)} {(SQ <"merge with case-changing rename">)} { (SQ <"\n"> <"\ttest $(git config core.ignorecase) = true &&\n"> <"\t>TestCase &&\n"> <"\tgit add TestCase &&\n"> <"\tgit commit -m \"add TestCase\" &&\n"> <"\tgit tag baseline &&\n"> <"\tgit checkout -b with-camel &&\n"> <"\t>foo &&\n"> <"\tgit add foo &&\n"> <"\tgit commit -m \"intervening commit\" &&\n"> <"\tgit checkout master &&\n"> <"\tgit rm TestCase &&\n"> <"\t>testcase &&\n"> <"\tgit add testcase &&\n"> <"\tgit commit -m \"rename to testcase\" &&\n"> <"\tgit checkout with-camel &&\n"> <"\tgit merge master -m \"merge\" &&\n"> <"\ttest_path_is_file testcase\n"> ) } ) (C {(test_expect_success)} {(SQ <"merge with case-changing rename on both sides">)} { (SQ <"\n"> <"\tgit checkout master &&\n"> <"\tgit reset --hard baseline &&\n"> <"\tgit branch -D with-camel &&\n"> <"\tgit checkout -b with-camel &&\n"> <"\tgit mv TestCase testcase &&\n"> <"\tgit commit -m \"recase on branch\" &&\n"> <"\t>foo &&\n"> <"\tgit add foo &&\n"> <"\tgit commit -m \"intervening commit\" &&\n"> <"\tgit checkout master &&\n"> <"\tgit rm TestCase &&\n"> <"\t>testcase &&\n"> <"\tgit add testcase &&\n"> <"\tgit commit -m \"rename to testcase\" &&\n"> <"\tgit checkout with-camel &&\n"> <"\tgit merge master -m \"merge\" &&\n"> <"\ttest_path_is_file testcase\n"> ) } ) (C {(test_done)}) ] )