From 67574c403f1e27660bbd0348b81b31adc9889b20 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Wed, 1 Jun 2005 11:38:07 -0700 Subject: [PATCH] diff: mode bits fixes The core GIT repository has trees that record regular file mode in 0664 instead of normalized 0644 pattern. Comparing such a tree with another tree that records the same file in 0644 pattern without content changes with git-diff-tree causes it to feed otherwise unmodified pairs to the diff_change() routine, which triggers a sanity check routine and barfs. This patch fixes the problem, along with the fix to another caller that uses unnormalized mode bits to call diff_change() routine in a similar way. Without this patch, you will see "fatal error" from diff-tree when you run git-deltafy-script on the core GIT repository itself. Signed-off-by: Junio C Hamano Signed-off-by: Linus Torvalds --- diff.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'diff.c') diff --git a/diff.c b/diff.c index d7cde8fa05..7cf40daee5 100644 --- a/diff.c +++ b/diff.c @@ -854,12 +854,14 @@ static void diff_resolve_rename_copy(void) else if (memcmp(p->one->sha1, p->two->sha1, 20) || p->one->mode != p->two->mode) p->status = 'M'; - else - /* this is a "no-change" entry. - * should not happen anymore. - * p->status = 'X'; + else { + /* This is a "no-change" entry and should not + * happen anymore, but prepare for broken callers. */ - die("internal error in diffcore: unmodified entry remains"); + error("feeding unmodified %s to diffcore", + p->one->path); + p->status = 'X'; + } } diff_debug_queue("resolve-rename-copy done", q); } -- cgit v1.2.1