{"thread":{"id":"6493","subject":"[PATCH 3/4] add a test case for git-merge-one-file","startedAt":"2007-01-24T01:14:18Z","lastAt":"2007-01-25T08:34:16Z","messageCount":3,"participants":["Johannes Schindelin","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":4},"messages":[{"id":"32468","messageId":"Pine.LNX.4.63.0701240214000.22628@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"6493","inReplyTo":null,"subject":"[PATCH 3/4] add a test case for git-merge-one-file","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-01-24T01:14:18Z","receivedAt":"2007-01-24T01:14:18Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\nEventually, merge-one-file should go away. But in the meantime\nlet's make sure we don't have any regressions.\n\nSigned-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>\n---\n t/t6025-merge-one-file.sh |   96 +++++++++++++++++++++++++++++++++++++++++++++\n 1 files changed, 96 insertions(+), 0 deletions(-)\n create mode 100644 t/t6025-merge-one-file.sh\n\ndiff --git a/t/t6025-merge-one-file.sh b/t/t6025-merge-one-file.sh\nnew file mode 100644\nindex 0000000..2eadcb3\n--- /dev/null\n+++ b/t/t6025-merge-one-file.sh\n@@ -0,0 +1,96 @@\n+#!/bin/sh\n+\n+test_description='Test merge-one-file'\n+. ./test-lib.sh\n+\n+for w in one two three; do\n+\techo $w > $w\n+\tgit-hash-object -t blob -w $w\n+\teval hash_$w=$(git-hash-object -t blob -w $w)\n+done\n+\n+git-update-index --index-info << EOF\n+10644 $hash_one 1\tone\n+10644 $hash_two 2\tone\n+10644 $hash_three 3\tone\n+EOF\n+\n+test_expect_failure \"1 -> 2 -> 3\" \\\n+\t\"git-merge-one-file $hash_one $hash_two $hash_three two 0644 0644 0644\"\n+\n+git-update-index --index-info << EOF\n+10644 $hash_one 1\ttwo\n+10644 $hash_three 3\ttwo\n+EOF\n+\n+test_expect_failure \"deleted in our; modified in their\" \\\n+\t\"git-merge-one-file $hash_one '' $hash_three two 0644 '' 0644\"\n+\n+git-update-index --index-info << EOF\n+10644 $hash_one 1\ttwo\n+10644 $hash_one 3\ttwo\n+EOF\n+\n+test_expect_success \"deleted in our\" \\\n+\t\"git-merge-one-file $hash_one '' $hash_one two 0644 '' 0644\"\n+\n+test_expect_success \"-> file untouched in work tree\" \"test -f two\"\n+\n+git-update-index --index-info << EOF\n+10644 $hash_one 1\ttwo\n+10644 $hash_one 2\ttwo\n+EOF\n+\n+test_expect_success \"deleted in their\" \\\n+\t\"git-merge-one-file $hash_one $hash_one '' two 0644 0644 ''\"\n+\n+test_expect_success \"-> now deleted in work tree\" \"test ! -f two\"\n+\n+git-update-index --index-info << EOF\n+10644 $hash_one 2\ttwo\n+10644 $hash_one 3\ttwo\n+EOF\n+\n+test_expect_failure \"created identically, but mode differs\" \\\n+\t\"git-merge-one-file '' $hash_one $hash_one two '' 0644 0755\"\n+\n+test_expect_success \"created identically\" \\\n+\t\"git-merge-one-file '' $hash_one $hash_one two '' 0644 0644\"\n+\n+test_expect_success \"-> correct file\" \"test z$(cat two) = zone\"\n+\n+cat one three > thirteen\n+hash_13=$(git-hash-object -t blob -w thirteen)\n+\n+git-update-index --index-info << EOF\n+10644 $hash_one 2\ttwo\n+10644 $hash_13 3\ttwo\n+EOF\n+\n+test_expect_failure \"created non-identically, but mergeable\" \\\n+\t\"git-merge-one-file '' $hash_one $hash_13 two '' 0644 0644\"\n+\n+test_expect_success \"-> correct file\" \"diff -u thirteen two\"\n+\n+git-update-index --index-info << EOF\n+10644 $hash_one 1\ttwo\n+10644 $hash_two 2\ttwo\n+10644 $hash_three 3\ttwo\n+EOF\n+\n+test_expect_failure \"modified non-identically\" \\\n+\t\"git-merge-one-file $hash_one $hash_two $hash_three two 0644 0644 0644\"\n+\n+cat > expect << EOF\n+<<<<<<<\n+two\n+=======\n+three\n+>>>>>>>\n+EOF\n+\n+sed -e \"s/<<<<<<< .*/<<<<<<</\" -e \"s/>>>>>>> .*/>>>>>>>/\" < two > out\n+\n+test_expect_success \"-> correct file\" \"diff -u expect out\"\n+\n+test_done\n-- \n1.5.0.rc2.gc5868-dirty\n"},{"id":"32576","messageId":"7vy7nsc6f0.fsf@assigned-by-dhcp.cox.net","threadId":"6493","inReplyTo":"Pine.LNX.4.63.0701240214000.22628@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH 3/4] add a test case for git-merge-one-file","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-01-25T00:10:43Z","receivedAt":"2007-01-25T00:10:43Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> +git-update-index --index-info << EOF\n> +10644 $hash_one 1\tone\n> +10644 $hash_two 2\tone\n> +10644 $hash_three 3\tone\n> +EOF\n\nHow can this work with 10644 instead of 100644?  Did you spot a\nbug in update-index --index-info?\n"},{"id":"32593","messageId":"Pine.LNX.4.63.0701250932360.22628@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"6493","inReplyTo":"7vy7nsc6f0.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH 3/4] add a test case for git-merge-one-file","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-01-25T08:34:16Z","receivedAt":"2007-01-25T08:34:16Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 24 Jan 2007, Junio C Hamano wrote:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> \n> > +git-update-index --index-info << EOF\n> > +10644 $hash_one 1\tone\n> > +10644 $hash_two 2\tone\n> > +10644 $hash_three 3\tone\n> > +EOF\n> \n> How can this work with 10644 instead of 100644?  Did you spot a\n> bug in update-index --index-info?\n\nActually, since !S_ISLNK(010644), it uses ce_permissions(010644), which \nbasically only checks if (010644 & 0100) is set (i.e. if it is executable \nby the user), and depending on this returns 0755 or 0644.\n\nThat's why it works.\n\nCiao,\nDscho\n"}]}