author | Linus Torvalds <torvalds@linux-foundation.org> | |
Thu, 18 Oct 2007 06:31:30 +0000 (02:31 -0400) | ||
committer | Shawn O. Pearce <spearce@spearce.org> | |
Thu, 18 Oct 2007 06:31:30 +0000 (02:31 -0400) | ||
commit | cd8ae20195ae09c06d0854f1ebf92d1f1164c927 | |
tree | ed65d9843eac52619f5d696b865e2e2e14697d61 | tree | snapshot |
parent | 93a56c2cf7c8b29ca4c5e0740fe1e487324ffc73 | commit | diff |
git-blame shouldn't crash if run in an unmerged tree
If we are in the middle of resolving a merge conflict there may be
one or more files whose entries in the index represent an unmerged
state (index entries in the higher-order stages).
Attempting to run git-blame on any file in such a working directory
resulted in "fatal: internal error: ce_mode is 0" as we use the magic
marker for an unmerged entry is 0 (set up by things like diff-lib.c's
do_diff_cache() and builtin-read-tree.c's read_tree_unmerged())
and the ce_match_stat_basic() function gets upset about this.
I'm not entirely sure that the whole "ce_mode = 0" case is a good
idea to begin with, and maybe the right thing to do is to remove
that horrid freakish special case, but removing the internal error
seems to be the simplest fix for now.
Linus
[sp: Thanks to Björn Steinbrink for the test case]
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
If we are in the middle of resolving a merge conflict there may be
one or more files whose entries in the index represent an unmerged
state (index entries in the higher-order stages).
Attempting to run git-blame on any file in such a working directory
resulted in "fatal: internal error: ce_mode is 0" as we use the magic
marker for an unmerged entry is 0 (set up by things like diff-lib.c's
do_diff_cache() and builtin-read-tree.c's read_tree_unmerged())
and the ce_match_stat_basic() function gets upset about this.
I'm not entirely sure that the whole "ce_mode = 0" case is a good
idea to begin with, and maybe the right thing to do is to remove
that horrid freakish special case, but removing the internal error
seems to be the simplest fix for now.
Linus
[sp: Thanks to Björn Steinbrink for the test case]
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
read-cache.c | diff | blob | history | |
t/t8004-blame.sh | [new file with mode: 0755] | blob |