Commit 191474a1f423aaea6f0b9dacf68216b3ba8e34d4

Edward Thomson 2017-02-09T18:28:19

diff: don't do rename detection on submodules

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
diff --git a/src/diff_tform.c b/src/diff_tform.c
index f2ff147..b004ddd 100644
--- a/src/diff_tform.c
+++ b/src/diff_tform.c
@@ -553,8 +553,8 @@ static int similarity_measure(
 
 	*score = -1;
 
-	/* don't try to compare files of different types */
-	if (GIT_MODE_TYPE(a_file->mode) != GIT_MODE_TYPE(b_file->mode))
+	/* don't try to compare things that aren't files */
+	if (!GIT_MODE_ISBLOB(a_file->mode) || !GIT_MODE_ISBLOB(b_file->mode))
 		return 0;
 
 	/* if exact match is requested, force calculation of missing OIDs now */