diff options
Diffstat (limited to 't')
23 files changed, 634 insertions, 32 deletions
diff --git a/t/t0003-attributes.sh b/t/t0003-attributes.sh index 3d8e06a20f..1c77192eb3 100755 --- a/t/t0003-attributes.sh +++ b/t/t0003-attributes.sh @@ -47,6 +47,23 @@ test_expect_success 'attribute test' ' ' +test_expect_success 'attribute test: read paths from stdin' ' + + cat <<EOF > expect +f: test: f +a/f: test: f +a/c/f: test: f +a/g: test: a/g +a/b/g: test: a/b/g +b/g: test: unspecified +a/b/h: test: a/b/h +a/b/d/g: test: a/b/d/* +EOF + + sed -e "s/:.*//" < expect | git check-attr --stdin test > actual && + test_cmp expect actual +' + test_expect_success 'root subdir attribute test' ' attr_check a/i a/i && diff --git a/t/t1005-read-tree-reset.sh b/t/t1005-read-tree-reset.sh index b0d31f5a9b..849911683a 100755 --- a/t/t1005-read-tree-reset.sh +++ b/t/t1005-read-tree-reset.sh @@ -27,4 +27,64 @@ test_expect_success 'reset should work' ' test_cmp expect actual ' +test_expect_success 'reset should remove remnants from a failed merge' ' + git read-tree --reset -u HEAD && + git ls-files -s >expect && + sha1=$(git rev-parse :new) && + ( + echo "100644 $sha1 1 old" + echo "100644 $sha1 3 old" + ) | git update-index --index-info && + >old && + git ls-files -s && + git read-tree --reset -u HEAD && + git ls-files -s >actual && + ! test -f old +' + +test_expect_success 'Porcelain reset should remove remnants too' ' + git read-tree --reset -u HEAD && + git ls-files -s >expect && + sha1=$(git rev-parse :new) && + ( + echo "100644 $sha1 1 old" + echo "100644 $sha1 3 old" + ) | git update-index --index-info && + >old && + git ls-files -s && + git reset --hard && + git ls-files -s >actual && + ! test -f old +' + +test_expect_success 'Porcelain checkout -f should remove remnants too' ' + git read-tree --reset -u HEAD && + git ls-files -s >expect && + sha1=$(git rev-parse :new) && + ( + echo "100644 $sha1 1 old" + echo "100644 $sha1 3 old" + ) | git update-index --index-info && + >old && + git ls-files -s && + git checkout -f && + git ls-files -s >actual && + ! test -f old +' + +test_expect_success 'Porcelain checkout -f HEAD should remove remnants too' ' + git read-tree --reset -u HEAD && + git ls-files -s >expect && + sha1=$(git rev-parse :new) && + ( + echo "100644 $sha1 1 old" + echo "100644 $sha1 3 old" + ) | git update-index --index-info && + >old && + git ls-files -s && + git checkout -f HEAD && + git ls-files -s >actual && + ! test -f old +' + test_done diff --git a/t/t1301-shared-repo.sh b/t/t1301-shared-repo.sh index 2275caa317..653362ba22 100755 --- a/t/t1301-shared-repo.sh +++ b/t/t1301-shared-repo.sh @@ -20,6 +20,10 @@ test_expect_success 'shared = 0400 (faulty permission u-w)' ' test $ret != "0" ' +modebits () { + ls -l "$1" | sed -e 's|^\(..........\).*|\1|' +} + for u in 002 022 do test_expect_success "shared=1 does not clear bits preset by umask $u" ' @@ -85,8 +89,7 @@ do rm -f .git/info/refs && git update-server-info && - actual="$(ls -l .git/info/refs)" && - actual=${actual%% *} && + actual="$(modebits .git/info/refs)" && test "x$actual" = "x-$y" || { ls -lt .git/info false @@ -98,8 +101,7 @@ do rm -f .git/info/refs && git update-server-info && - actual="$(ls -l .git/info/refs)" && - actual=${actual%% *} && + actual="$(modebits .git/info/refs)" && test "x$actual" = "x-$x" || { ls -lt .git/info false diff --git a/t/t3409-rebase-hook.sh b/t/t3409-rebase-hook.sh index bc93dda8fd..1f1b850677 100755 --- a/t/t3409-rebase-hook.sh +++ b/t/t3409-rebase-hook.sh @@ -123,4 +123,20 @@ test_expect_success 'pre-rebase hook stops rebase (2)' ' test 0 = $(git rev-list HEAD...side | wc -l) ' +test_expect_success 'rebase --no-verify overrides pre-rebase (1)' ' + git checkout test && + git reset --hard side && + git rebase --no-verify master && + test "z$(git symbolic-ref HEAD)" = zrefs/heads/test && + test "z$(cat git)" = zworld +' + +test_expect_success 'rebase --no-verify overrides pre-rebase (2)' ' + git checkout test && + git reset --hard side && + EDITOR=true git rebase --no-verify -i master && + test "z$(git symbolic-ref HEAD)" = zrefs/heads/test && + test "z$(cat git)" = zworld +' + test_done diff --git a/t/t3409-rebase-preserve-merges.sh b/t/t3409-rebase-preserve-merges.sh new file mode 100755 index 0000000000..8cde40f8e8 --- /dev/null +++ b/t/t3409-rebase-preserve-merges.sh @@ -0,0 +1,61 @@ +#!/bin/sh +# +# Copyright(C) 2008 Stephen Habermann & Andreas Ericsson +# +test_description='git rebase -p should preserve merges + +Run "git rebase -p" and check that merges are properly carried along +' +. ./test-lib.sh + +GIT_AUTHOR_EMAIL=bogus_email_address +export GIT_AUTHOR_EMAIL + +#echo 'Setting up: +# +#A1--A2 <-- origin/master +# \ \ +# B1--M <-- topic +# \ +# B2 <-- origin/topic +# +#' + +test_expect_success 'setup for merge-preserving rebase' \ + 'echo First > A && + git add A && + git-commit -m "Add A1" && + git checkout -b topic && + echo Second > B && + git add B && + git-commit -m "Add B1" && + git checkout -f master && + echo Third >> A && + git-commit -a -m "Modify A2" && + + git clone ./. clone1 && + cd clone1 && + git checkout -b topic origin/topic && + git merge origin/master && + cd .. + + git clone ./. clone2 + cd clone2 && + git checkout -b topic origin/topic && + git merge origin/master && + cd .. && + + git checkout topic && + echo Fourth >> B && + git commit -a -m "Modify B2" +' + +test_expect_success 'rebase -p fakes interactive rebase' ' + cd clone2 && + git fetch && + git rebase -p origin/topic && + test 1 = $(git rev-list --all --pretty=oneline | grep "Modify A" | wc -l) && + test 1 = $(git rev-list --all --pretty=oneline | grep "Merge commit" | wc -l) +' + +test_done diff --git a/t/t3410-rebase-preserve-dropped-merges.sh b/t/t3410-rebase-preserve-dropped-merges.sh new file mode 100755 index 0000000000..5816415aaf --- /dev/null +++ b/t/t3410-rebase-preserve-dropped-merges.sh @@ -0,0 +1,139 @@ +#!/bin/sh +# +# Copyright (c) 2008 Stephen Haberman +# + +test_description='git rebase preserve merges + +This test runs git rebase with preserve merges and ensures commits +dropped by the --cherry-pick flag have their childrens parents +rewritten. +' +. ./test-lib.sh + +# set up two branches like this: +# +# A - B - C - D - E +# \ +# F - G - H +# \ +# I +# +# where B, D and G touch the same file. + +test_expect_success 'setup' ' + : > file1 && + git add file1 && + test_tick && + git commit -m A && + git tag A && + echo 1 > file1 && + test_tick && + git commit -m B file1 && + : > file2 && + git add file2 && + test_tick && + git commit -m C && + echo 2 > file1 && + test_tick && + git commit -m D file1 && + : > file3 && + git add file3 && + test_tick && + git commit -m E && + git tag E && + git checkout -b branch1 A && + : > file4 && + git add file4 && + test_tick && + git commit -m F && + git tag F && + echo 3 > file1 && + test_tick && + git commit -m G file1 && + git tag G && + : > file5 && + git add file5 && + test_tick && + git commit -m H && + git tag H && + git checkout -b branch2 F && + : > file6 && + git add file6 && + test_tick && + git commit -m I && + git tag I +' + +# A - B - C - D - E +# \ \ \ +# F - G - H -- L \ --> L +# \ | \ +# I -- G2 -- J -- K I -- K +# G2 = same changes as G +test_expect_success 'skip same-resolution merges with -p' ' + git checkout branch1 && + ! git merge E && + echo 23 > file1 && + git add file1 && + git commit -m L && + git checkout branch2 && + echo 3 > file1 && + git commit -a -m G2 && + ! git merge E && + echo 23 > file1 && + git add file1 && + git commit -m J && + echo file7 > file7 && + git add file7 && + git commit -m K && + GIT_EDITOR=: git rebase -i -p branch1 && + test $(git rev-parse branch2^^) = $(git rev-parse branch1) && + test "23" = "$(cat file1)" && + test "" = "$(cat file6)" && + test "file7" = "$(cat file7)" && + + git checkout branch1 && + git reset --hard H && + git checkout branch2 && + git reset --hard I +' + +# A - B - C - D - E +# \ \ \ +# F - G - H -- L \ --> L +# \ | \ +# I -- G2 -- J -- K I -- G2 -- K +# G2 = different changes as G +test_expect_success 'keep different-resolution merges with -p' ' + git checkout branch1 && + ! git merge E && + echo 23 > file1 && + git add file1 && + git commit -m L && + git checkout branch2 && + echo 4 > file1 && + git commit -a -m G2 && + ! git merge E && + echo 24 > file1 && + git add file1 && + git commit -m J && + echo file7 > file7 && + git add file7 && + git commit -m K && + ! GIT_EDITOR=: git rebase -i -p branch1 && + echo 234 > file1 && + git add file1 && + GIT_EDITOR=: git rebase --continue && + test $(git rev-parse branch2^^^) = $(git rev-parse branch1) && + test "234" = "$(cat file1)" && + test "" = "$(cat file6)" && + test "file7" = "$(cat file7)" && + + git checkout branch1 && + git reset --hard H && + git checkout branch2 && + git reset --hard I +' + +test_done diff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh index fe6080da57..aeb5405cfe 100755 --- a/t/t4013-diff-various.sh +++ b/t/t4013-diff-various.sh @@ -236,12 +236,15 @@ show --patch-with-stat --summary side format-patch --stdout initial..side format-patch --stdout initial..master^ format-patch --stdout initial..master +format-patch --stdout --no-numbered initial..master +format-patch --stdout --numbered initial..master format-patch --attach --stdout initial..side format-patch --attach --stdout initial..master^ format-patch --attach --stdout initial..master format-patch --inline --stdout initial..side format-patch --inline --stdout initial..master^ format-patch --inline --stdout initial..master +format-patch --inline --stdout initial..master format-patch --inline --stdout --subject-prefix=TESTCASE initial..master config format.subjectprefix DIFFERENT_PREFIX format-patch --inline --stdout initial..master^^ diff --git a/t/t4013/diff.format-patch_--attach_--stdout_initial..master b/t/t4013/diff.format-patch_--attach_--stdout_initial..master index 43346b9ba4..e5ab74437e 100644 --- a/t/t4013/diff.format-patch_--attach_--stdout_initial..master +++ b/t/t4013/diff.format-patch_--attach_--stdout_initial..master @@ -2,7 +2,7 @@ $ git format-patch --attach --stdout initial..master From 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44 Mon Sep 17 00:00:00 2001 From: A U Thor <author@example.com> Date: Mon, 26 Jun 2006 00:01:00 +0000 -Subject: [PATCH] Second +Subject: [PATCH 1/3] Second MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------g-i-t--v-e-r-s-i-o-n" @@ -63,7 +63,7 @@ index 01e79c3..0000000 From 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0 Mon Sep 17 00:00:00 2001 From: A U Thor <author@example.com> Date: Mon, 26 Jun 2006 00:02:00 +0000 -Subject: [PATCH] Third +Subject: [PATCH 2/3] Third MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------g-i-t--v-e-r-s-i-o-n" @@ -111,7 +111,7 @@ index 0000000..b1e6722 From c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a Mon Sep 17 00:00:00 2001 From: A U Thor <author@example.com> Date: Mon, 26 Jun 2006 00:03:00 +0000 -Subject: [PATCH] Side +Subject: [PATCH 3/3] Side MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------g-i-t--v-e-r-s-i-o-n" diff --git a/t/t4013/diff.format-patch_--attach_--stdout_initial..master^ b/t/t4013/diff.format-patch_--attach_--stdout_initial..master^ index d7490a9fd7..2c71d20d37 100644 --- a/t/t4013/diff.format-patch_--attach_--stdout_initial..master^ +++ b/t/t4013/diff.format-patch_--attach_--stdout_initial..master^ @@ -2,7 +2,7 @@ $ git format-patch --attach --stdout initial..master^ From 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44 Mon Sep 17 00:00:00 2001 From: A U Thor <author@example.com> Date: Mon, 26 Jun 2006 00:01:00 +0000 -Subject: [PATCH] Second +Subject: [PATCH 1/2] Second MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------g-i-t--v-e-r-s-i-o-n" @@ -63,7 +63,7 @@ index 01e79c3..0000000 From 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0 Mon Sep 17 00:00:00 2001 From: A U Thor <author@example.com> Date: Mon, 26 Jun 2006 00:02:00 +0000 -Subject: [PATCH] Third +Subject: [PATCH 2/2] Third MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------g-i-t--v-e-r-s-i-o-n" diff --git a/t/t4013/diff.format-patch_--inline_--stdout_--subject-prefix=TESTCASE_initial..master b/t/t4013/diff.format-patch_--inline_--stdout_--subject-prefix=TESTCASE_initial..master index fca5cce373..58f8a7b7d6 100644 --- a/t/t4013/diff.format-patch_--inline_--stdout_--subject-prefix=TESTCASE_initial..master +++ b/t/t4013/diff.format-patch_--inline_--stdout_--subject-prefix=TESTCASE_initial..master @@ -2,7 +2,7 @@ $ git format-patch --inline --stdout --subject-prefix=TESTCASE initial..master From 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44 Mon Sep 17 00:00:00 2001 From: A U Thor <author@example.com> Date: Mon, 26 Jun 2006 00:01:00 +0000 -Subject: [TESTCASE] Second +Subject: [TESTCASE 1/3] Second MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------g-i-t--v-e-r-s-i-o-n" @@ -63,7 +63,7 @@ index 01e79c3..0000000 From 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0 Mon Sep 17 00:00:00 2001 From: A U Thor <author@example.com> Date: Mon, 26 Jun 2006 00:02:00 +0000 -Subject: [TESTCASE] Third +Subject: [TESTCASE 2/3] Third MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------g-i-t--v-e-r-s-i-o-n" @@ -111,7 +111,7 @@ index 0000000..b1e6722 From c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a Mon Sep 17 00:00:00 2001 From: A U Thor <author@example.com> Date: Mon, 26 Jun 2006 00:03:00 +0000 -Subject: [TESTCASE] Side +Subject: [TESTCASE 3/3] Side MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------g-i-t--v-e-r-s-i-o-n" diff --git a/t/t4013/diff.format-patch_--inline_--stdout_initial..master b/t/t4013/diff.format-patch_--inline_--stdout_initial..master index 6d6fac3908..9e7bbdffa2 100644 --- a/t/t4013/diff.format-patch_--inline_--stdout_initial..master +++ b/t/t4013/diff.format-patch_--inline_--stdout_initial..master @@ -2,7 +2,7 @@ $ git format-patch --inline --stdout initial..master From 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44 Mon Sep 17 00:00:00 2001 From: A U Thor <author@example.com> Date: Mon, 26 Jun 2006 00:01:00 +0000 -Subject: [PATCH] Second +Subject: [PATCH 1/3] Second MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------g-i-t--v-e-r-s-i-o-n" @@ -63,7 +63,7 @@ index 01e79c3..0000000 From 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0 Mon Sep 17 00:00:00 2001 From: A U Thor <author@example.com> Date: Mon, 26 Jun 2006 00:02:00 +0000 -Subject: [PATCH] Third +Subject: [PATCH 2/3] Third MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------g-i-t--v-e-r-s-i-o-n" @@ -111,7 +111,7 @@ index 0000000..b1e6722 From c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a Mon Sep 17 00:00:00 2001 From: A U Thor <author@example.com> Date: Mon, 26 Jun 2006 00:03:00 +0000 -Subject: [PATCH] Side +Subject: [PATCH 3/3] Side MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------g-i-t--v-e-r-s-i-o-n" diff --git a/t/t4013/diff.format-patch_--inline_--stdout_initial..master^ b/t/t4013/diff.format-patch_--inline_--stdout_initial..master^ index 18a1110def..f881f644cc 100644 --- a/t/t4013/diff.format-patch_--inline_--stdout_initial..master^ +++ b/t/t4013/diff.format-patch_--inline_--stdout_initial..master^ @@ -2,7 +2,7 @@ $ git format-patch --inline --stdout initial..master^ From 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44 Mon Sep 17 00:00:00 2001 From: A U Thor <author@example.com> Date: Mon, 26 Jun 2006 00:01:00 +0000 -Subject: [PATCH] Second +Subject: [PATCH 1/2] Second MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------g-i-t--v-e-r-s-i-o-n" @@ -63,7 +63,7 @@ index 01e79c3..0000000 From 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0 Mon Sep 17 00:00:00 2001 From: A U Thor <author@example.com> Date: Mon, 26 Jun 2006 00:02:00 +0000 -Subject: [PATCH] Third +Subject: [PATCH 2/2] Third MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------g-i-t--v-e-r-s-i-o-n" diff --git a/t/t4013/diff.format-patch_--stdout_--no-numbered_initial..master b/t/t4013/diff.format-patch_--stdout_--no-numbered_initial..master new file mode 100644 index 0000000000..f7752ebbea --- /dev/null +++ b/t/t4013/diff.format-patch_--stdout_--no-numbered_initial..master @@ -0,0 +1,127 @@ +$ git format-patch --stdout --no-numbered initial..master +From 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44 Mon Sep 17 00:00:00 2001 +From: A U Thor <author@example.com> +Date: Mon, 26 Jun 2006 00:01:00 +0000 +Subject: [PATCH] Second + +This is the second commit. +--- + dir/sub | 2 ++ + file0 | 3 +++ + file2 | 3 --- + 3 files changed, 5 insertions(+), 3 deletions(-) + delete mode 100644 file2 + +diff --git a/dir/sub b/dir/sub +index 35d242b..8422d40 100644 +--- a/dir/sub ++++ b/dir/sub +@@ -1,2 +1,4 @@ + A + B ++C ++D +diff --git a/file0 b/file0 +index 01e79c3..b414108 100644 +--- a/file0 ++++ b/file0 +@@ -1,3 +1,6 @@ + 1 + 2 + 3 ++4 ++5 ++6 +diff --git a/file2 b/file2 +deleted file mode 100644 +index 01e79c3..0000000 +--- a/file2 ++++ /dev/null +@@ -1,3 +0,0 @@ +-1 +-2 +-3 +-- +g-i-t--v-e-r-s-i-o-n + + +From 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0 Mon Sep 17 00:00:00 2001 +From: A U Thor <author@example.com> +Date: Mon, 26 Jun 2006 00:02:00 +0000 +Subject: [PATCH] Third + +--- + dir/sub | 2 ++ + file1 | 3 +++ + 2 files changed, 5 insertions(+), 0 deletions(-) + create mode 100644 file1 + +diff --git a/dir/sub b/dir/sub +index 8422d40..cead32e 100644 +--- a/dir/sub ++++ b/dir/sub +@@ -2,3 +2,5 @@ A + B + C + D ++E ++F +diff --git a/file1 b/file1 +new file mode 100644 +index 0000000..b1e6722 +--- /dev/null ++++ b/file1 +@@ -0,0 +1,3 @@ ++A ++B ++C +-- +g-i-t--v-e-r-s-i-o-n + + +From c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a Mon Sep 17 00:00:00 2001 +From: A U Thor <author@example.com> +Date: Mon, 26 Jun 2006 00:03:00 +0000 +Subject: [PATCH] Side + +--- + dir/sub | 2 ++ + file0 | 3 +++ + file3 | 4 ++++ + 3 files changed, 9 insertions(+), 0 deletions(-) + create mode 100644 file3 + +diff --git a/dir/sub b/dir/sub +index 35d242b..7289e35 100644 +--- a/dir/sub ++++ b/dir/sub +@@ -1,2 +1,4 @@ + A + B ++1 ++2 +diff --git a/file0 b/file0 +index 01e79c3..f4615da 100644 +--- a/file0 ++++ b/file0 +@@ -1,3 +1,6 @@ + 1 + 2 + 3 ++A ++B ++C +diff --git a/file3 b/file3 +new file mode 100644 +index 0000000..7289e35 +--- /dev/null ++++ b/file3 +@@ -0,0 +1,4 @@ ++A ++B ++1 ++2 +-- +g-i-t--v-e-r-s-i-o-n + +$ diff --git a/t/t4013/diff.format-patch_--stdout_--numbered_initial..master b/t/t4013/diff.format-patch_--stdout_--numbered_initial..master new file mode 100644 index 0000000000..8e67dbf76f --- /dev/null +++ b/t/t4013/diff.format-patch_--stdout_--numbered_initial..master @@ -0,0 +1,127 @@ +$ git format-patch --stdout --numbered initial..master +From 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44 Mon Sep 17 00:00:00 2001 +From: A U Thor <author@example.com> +Date: Mon, 26 Jun 2006 00:01:00 +0000 +Subject: [PATCH 1/3] Second + +This is the second commit. +--- + dir/sub | 2 ++ + file0 | 3 +++ + file2 | 3 --- + 3 files changed, 5 insertions(+), 3 deletions(-) + delete mode 100644 file2 + +diff --git a/dir/sub b/dir/sub +index 35d242b..8422d40 100644 +--- a/dir/sub ++++ b/dir/sub +@@ -1,2 +1,4 @@ + A + B ++C ++D +diff --git a/file0 b/file0 +index 01e79c3..b414108 100644 +--- a/file0 ++++ b/file0 +@@ -1,3 +1,6 @@ + 1 + 2 + 3 ++4 ++5 ++6 +diff --git a/file2 b/file2 +deleted file mode 100644 +index 01e79c3..0000000 +--- a/file2 ++++ /dev/null +@@ -1,3 +0,0 @@ +-1 +-2 +-3 +-- +g-i-t--v-e-r-s-i-o-n + + +From 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0 Mon Sep 17 00:00:00 2001 +From: A U Thor <author@example.com> +Date: Mon, 26 Jun 2006 00:02:00 +0000 +Subject: [PATCH 2/3] Third + +--- + dir/sub | 2 ++ + file1 | 3 +++ + 2 files changed, 5 insertions(+), 0 deletions(-) + create mode 100644 file1 + +diff --git a/dir/sub b/dir/sub +index 8422d40..cead32e 100644 +--- a/dir/sub ++++ b/dir/sub +@@ -2,3 +2,5 @@ A + B + C + D ++E ++F +diff --git a/file1 b/file1 +new file mode 100644 +index 0000000..b1e6722 +--- /dev/null ++++ b/file1 +@@ -0,0 +1,3 @@ ++A ++B ++C +-- +g-i-t--v-e-r-s-i-o-n + + +From c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a Mon Sep 17 00:00:00 2001 +From: A U Thor <author@example.com> +Date: Mon, 26 Jun 2006 00:03:00 +0000 +Subject: [PATCH 3/3] Side + +--- + dir/sub | 2 ++ + file0 | 3 +++ + file3 | 4 ++++ + 3 files changed, 9 insertions(+), 0 deletions(-) + create mode 100644 file3 + +diff --git a/dir/sub b/dir/sub +index 35d242b..7289e35 100644 +--- a/dir/sub ++++ b/dir/sub +@@ -1,2 +1,4 @@ + A + B ++1 ++2 +diff --git a/file0 b/file0 +index 01e79c3..f4615da 100644 +--- a/file0 ++++ b/file0 +@@ -1,3 +1,6 @@ + 1 + 2 + 3 ++A ++B ++C +diff --git a/file3 b/file3 +new file mode 100644 +index 0000000..7289e35 +--- /dev/null ++++ b/file3 +@@ -0,0 +1,4 @@ ++A ++B ++1 ++2 +-- +g-i-t--v-e-r-s-i-o-n + +$ diff --git a/t/t4013/diff.format-patch_--stdout_initial..master b/t/t4013/diff.format-patch_--stdout_initial..master index 8b88ca4927..7b89978e32 100644 --- a/t/t4013/diff.format-patch_--stdout_initial..master +++ b/t/t4013/diff.format-patch_--stdout_initial..master @@ -2,7 +2,7 @@ $ git format-patch --stdout initial..master From 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44 Mon Sep 17 00:00:00 2001 From: A U Thor <author@example.com> Date: Mon, 26 Jun 2006 00:01:00 +0000 -Subject: [PATCH] Second +Subject: [PATCH 1/3] Second This is the second commit. --- @@ -48,7 +48,7 @@ g-i-t--v-e-r-s-i-o-n From 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0 Mon Sep 17 00:00:00 2001 From: A U Thor <author@example.com> Date: Mon, 26 Jun 2006 00:02:00 +0000 -Subject: [PATCH] Third +Subject: [PATCH 2/3] Third --- dir/sub | 2 ++ @@ -82,7 +82,7 @@ g-i-t--v-e-r-s-i-o-n From c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a Mon Sep 17 00:00:00 2001 From: A U Thor <author@example.com> Date: Mon, 26 Jun 2006 00:03:00 +0000 -Subject: [PATCH] Side +Subject: [PATCH 3/3] Side --- dir/sub | 2 ++ diff --git a/t/t4013/diff.format-patch_--stdout_initial..master^ b/t/t4013/diff.format-patch_--stdout_initial..master^ index 47a4b88637..b7f9725dc4 100644 --- a/t/t4013/diff.format-patch_--stdout_initial..master^ +++ b/t/t4013/diff.format-patch_--stdout_initial..master^ @@ -2,7 +2,7 @@ $ git format-patch --stdout initial..master^ From 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44 Mon Sep 17 00:00:00 2001 From: A U Thor <author@example.com> Date: Mon, 26 Jun 2006 00:01:00 +0000 -Subject: [PATCH] Second +Subject: [PATCH 1/2] Second This is the second commit. --- @@ -48,7 +48,7 @@ g-i-t--v-e-r-s-i-o-n From 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0 Mon Sep 17 00:00:00 2001 From: A U Thor <author@example.com> Date: Mon, 26 Jun 2006 00:02:00 +0000 -Subject: [PATCH] Third +Subject: [PATCH 2/2] Third --- dir/sub | 2 ++ diff --git a/t/t4021-format-patch-numbered.sh b/t/t4021-format-patch-numbered.sh index 43d64bbd82..390af2389f 100755 --- a/t/t4021-format-patch-numbered.sh +++ b/t/t4021-format-patch-numbered.sh @@ -45,17 +45,22 @@ test_numbered() { grep "^Subject: \[PATCH 2/2\]" $1 } -test_expect_success 'Default: no numbered' ' +test_expect_success 'single patch defaults to no numbers' ' + git format-patch --stdout HEAD~1 >patch0.single && + test_single_no_numbered patch0.single +' + +test_expect_success 'multiple patch defaults to numbered' ' - git format-patch --stdout HEAD~2 >patch0 && - test_no_numbered patch0 + git format-patch --stdout HEAD~2 >patch0.multiple && + test_numbered patch0.multiple ' test_expect_success 'Use --numbered' ' - git format-patch --numbered --stdout HEAD~2 >patch1 && - test_numbered patch1 + git format-patch --numbered --stdout HEAD~1 >patch1 && + test_single_numbered patch1 ' diff --git a/t/t4151-am-abort.sh b/t/t4151-am-abort.sh index 4448aba7e0..2b912d7728 100755 --- a/t/t4151-am-abort.sh +++ b/t/t4151-am-abort.sh @@ -22,7 +22,7 @@ test_expect_success setup ' test_tick && git commit -a -m $i || break done && - git format-patch initial && + git format-patch --no-numbered initial && git checkout -b side initial && echo local change >file-2-expect ' diff --git a/t/t5302-pack-index.sh b/t/t5302-pack-index.sh index 6424db1f28..344ab25b8b 100755 --- a/t/t5302-pack-index.sh +++ b/t/t5302-pack-index.sh @@ -177,4 +177,14 @@ test_expect_success \ ".git/objects/pack/pack-${pack1}.pack" 2>&1) && echo "$err" | grep "CRC mismatch"' +test_expect_success 'running index-pack in the object store' ' + rm -f .git/objects/pack/* && + cp test-1-${pack1}.pack .git/objects/pack/pack-${pack1}.pack && + ( + cd .git/objects/pack + git index-pack pack-${pack1}.pack + ) && + test -f .git/objects/pack/pack-${pack1}.idx +' + test_done diff --git a/t/t5702-clone-options.sh b/t/t5702-clone-options.sh index 328e4d9a33..27825f5f31 100755 --- a/t/t5702-clone-options.sh +++ b/t/t5702-clone-options.sh @@ -19,4 +19,17 @@ test_expect_success 'clone -o' ' ' +test_expect_success 'redirected clone' ' + + git clone "file://$(pwd)/parent" clone-redirected >out 2>err && + test ! -s err + +' +test_expect_success 'redirected clone -v' ' + + git clone -v "file://$(pwd)/parent" clone-redirected-v >out 2>err && + test -s err + +' + test_done diff --git a/t/t6120-describe.sh b/t/t6120-describe.sh index 16cc635813..e6c9e59b61 100755 --- a/t/t6120-describe.sh +++ b/t/t6120-describe.sh @@ -91,10 +91,10 @@ check_describe D-* HEAD^^ check_describe A-* HEAD^^2 check_describe B HEAD^^2^ -check_describe A-* --tags HEAD -check_describe A-* --tags HEAD^ -check_describe D-* --tags HEAD^^ -check_describe A-* --tags HEAD^^2 +check_describe c-* --tags HEAD +check_describe c-* --tags HEAD^ +check_describe e-* --tags HEAD^^ +check_describe c-* --tags HEAD^^2 check_describe B --tags HEAD^^2^ check_describe B-0-* --long HEAD^^2^ diff --git a/t/t7502-status.sh b/t/t7502-status.sh index 1905fb34cd..93f875f500 100755 --- a/t/t7502-status.sh +++ b/t/t7502-status.sh @@ -292,6 +292,12 @@ test_expect_success 'status submodule summary is disabled by default' ' test_cmp expect output ' +# we expect the same as the previous test +test_expect_success 'status --untracked-files=all does not show submodule' ' + git status --untracked-files=all >output && + test_cmp expect output +' + head=$(cd sm && git rev-parse --short=7 --verify HEAD) cat >expect <<EOF diff --git a/t/t7600-merge.sh b/t/t7600-merge.sh index 3a36a95b9a..e5b210bc96 100755 --- a/t/t7600-merge.sh +++ b/t/t7600-merge.sh @@ -544,4 +544,20 @@ test_expect_success 'merge early part of c2' ' test_debug 'gitk --all' +test_expect_success 'merge --no-ff --no-commit && commit' ' + git reset --hard c0 && + git merge --no-ff --no-commit c1 && + EDITOR=: git commit && + verify_parents $c0 $c1 +' + +test_debug 'gitk --all' + +test_expect_success 'amending no-ff merge commit' ' + EDITOR=: git commit --amend && + verify_parents $c0 $c1 +' + +test_debug 'gitk --all' + test_done |