{"thread":{"id":"7280","subject":"[PATCH] Add test cases for handling of name conflicts between files and directories.","startedAt":"2007-03-17T00:00:04Z","lastAt":"2007-03-17T00:00:04Z","messageCount":1,"participants":["koreth@midwinter.com"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"37290","messageId":"20070317000004.GA14919@midwinter.com","threadId":"7280","inReplyTo":null,"subject":"[PATCH] Add test cases for handling of name conflicts between files and directories.","fromName":"","fromEmail":"koreth@midwinter.com","sentAt":"2007-03-17T00:00:04Z","receivedAt":"2007-03-17T00:00:04Z","isPatch":true,"sender":{"key":"koreth@midwinter.com","avatar":"https://gravatar.com/avatar/71b4d2e8b62f168bdc9e9205341159e3567003b4f9e2127c617c5fa0a1f5bad2?d=mp&s=160"},"body":"Here are a few test cases for the file/directory name conflict patch.\n\n---\n t/t7201-co.sh |   70 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n 1 files changed, 70 insertions(+), 0 deletions(-)\n\ndiff --git a/t/t7201-co.sh b/t/t7201-co.sh\nindex 867bbd2..6692f25 100755\n--- a/t/t7201-co.sh\n+++ b/t/t7201-co.sh\n@@ -36,6 +36,9 @@ test_expect_success setup '\n \tgit update-index --add --remove one two three &&\n \tgit commit -m \"Side M one, D two, A three\" &&\n \n+\tgit branch with-file master &&\n+\tgit branch with-dir master &&\n+\n \tgit checkout master\n '\n \n@@ -129,4 +132,71 @@ test_expect_success 'checkout -m with merge conflict' '\n \t! test -s current\n '\n \n+test_expect_success 'checkout with file/directory conflict' '\n+\n+\tgit checkout -f with-dir && git clean &&\n+\n+\tmv one one- &&\n+\tmkdir one &&\n+\tmv one- one/file &&\n+\tgit add one/file &&\n+\tgit commit -m \"with-dir D one A one/file\" &&\n+\t\n+\tgit checkout with-file &&\n+\tgit checkout with-dir\n+'\n+\n+test_expect_success 'checkout with file/directory conflict and modified file in dir' '\n+\n+\tgit checkout -f with-dir && git-clean &&\n+\n+\tfill 1 2 3 4 5 6 7 > one/file &&\n+\tif git checkout with-file\n+\tthen\n+\t\techo Should have detected modified file in subdirectory\n+\t\tfalse\n+\telse\n+\t\techo \"happy - failed correctly\"\n+\tfi\n+'\n+\n+test_expect_success 'checkout with file/directory conflict and untracked file in dir' '\n+\n+\tgit checkout -f with-dir && git-clean &&\n+\n+\tfill 1 2 3 > one/file2 &&\n+\tif git checkout with-file\n+\tthen\n+\t\techo Should have detected untracked file in subdirectory\n+\t\tfalse\n+\telse\n+\t\techo \"happy - failed correctly\"\n+\tfi &&\n+\trm one/file2\n+'\n+\n+test_expect_success 'checkout with file/directory conflict and deleted file in dir' '\n+\n+\tgit checkout -f with-dir && git-clean &&\n+\n+\trm one/file &&\n+\tgit checkout with-file\n+'\n+\n+test_expect_success 'checkout with file/directory conflict and modified file' '\n+\n+\tgit checkout -f with-file && git-clean &&\n+\n+\tfill 1 2 3 > one &&\n+\tif git checkout with-dir\n+\tthen\n+\t\techo Should have detected modified file\n+\t\tfalse\n+\telse\n+\t\techo \"happy - failed correctly\"\n+\tfi &&\n+\n+\tgit reset --hard\n+'\n+\n test_done\n-- \n1.5.0.4.404.gdbb2-dirty\n"}]}