summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 04b3305)
raw | patch | inline | side by side (parent: 04b3305)
author | Junio C Hamano <gitster@pobox.com> | |
Wed, 13 Feb 2008 21:13:21 +0000 (13:13 -0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 13 Feb 2008 21:43:02 +0000 (13:43 -0800) |
We used to use "cat-file commit $commit" to extract the original
author information from existing commit, but an earlier commit
5ac2715 (Consistent message encoding while reusing log from an
existing commit) changed it to use "git show -s $commit". If
you have a file in your work tree that can be interpreted as a
valid object name (e.g. "HEAD"), this conversion will not work.
Disambiguate by marking the end of revision parameter on the
comand line with an explicit "--" to fix this.
This breakage is most visible with rebase when a file called
"HEAD" exists in the worktree.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
author information from existing commit, but an earlier commit
5ac2715 (Consistent message encoding while reusing log from an
existing commit) changed it to use "git show -s $commit". If
you have a file in your work tree that can be interpreted as a
valid object name (e.g. "HEAD"), this conversion will not work.
Disambiguate by marking the end of revision parameter on the
comand line with an explicit "--" to fix this.
This breakage is most visible with rebase when a file called
"HEAD" exists in the worktree.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-sh-setup.sh | patch | blob | history | |
t/t3404-rebase-interactive.sh | patch | blob | history |
diff --git a/git-sh-setup.sh b/git-sh-setup.sh
index aae14090bd884920c7b5cb7530db66719df98ddd..f38827529f2fd60743f5571948742fada975cf93 100755 (executable)
--- a/git-sh-setup.sh
+++ b/git-sh-setup.sh
}
'
encoding=$(git config i18n.commitencoding || echo UTF-8)
- git show -s --pretty=raw --encoding="$encoding" "$1" |
+ git show -s --pretty=raw --encoding="$encoding" "$1" -- |
LANG=C LC_ALL=C sed -ne "$pick_author_script"
}
index e33ea4e9f4c33cc1f94cd184c371a8fa05bedf3b..e5ed74545b8a2ac9c2063b2ae40d7c661bda0260 100755 (executable)
'
+test_expect_success 'rebase with a file named HEAD in worktree' '
+
+ rm -fr .git/hooks &&
+ git reset --hard &&
+ git checkout -b branch3 A &&
+
+ (
+ GIT_AUTHOR_NAME="Squashed Away" &&
+ export GIT_AUTHOR_NAME &&
+ >HEAD &&
+ git add HEAD &&
+ git commit -m "Add head" &&
+ >BODY &&
+ git add BODY &&
+ git commit -m "Add body"
+ ) &&
+
+ FAKE_LINES="1 squash 2" git rebase -i to-be-rebased &&
+ test "$(git show -s --pretty=format:%an)" = "Squashed Away"
+
+'
+
test_done