Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--diff.c1
-rw-r--r--diffcore.h2
2 files changed, 2 insertions, 1 deletions
diff --git a/diff.c b/diff.c
index 046d9a3929..dd1c0b6d55 100644
--- a/diff.c
+++ b/diff.c
@@ -555,6 +555,7 @@ static void run_diff(const char *name,
{
const char *pgm = external_diff();
if (!pgm &&
+ one && two &&
DIFF_FILE_VALID(one) && DIFF_FILE_VALID(two) &&
(S_IFMT & one->mode) != (S_IFMT & two->mode)) {
/* a filepair that changes between file and symlink
diff --git a/diffcore.h b/diffcore.h
index ac159d7154..f1b5ca748c 100644
--- a/diffcore.h
+++ b/diffcore.h
@@ -33,7 +33,7 @@ struct diff_filespec {
* if false, use the name and read from
* the filesystem.
*/
-#define DIFF_FILE_VALID(spec) ((spec) && ((spec)->mode) != 0)
+#define DIFF_FILE_VALID(spec) (((spec)->mode) != 0)
unsigned should_free : 1; /* data should be free()'ed */
unsigned should_munmap : 1; /* data should be munmap()'ed */
};