Commit 494a2f235fd13de5f927ad64db0b3597569f02b9

Edward Thomson 2017-11-30T21:45:27

Merge pull request #4426 from pks-t/pks/diff-flag-set-fix diff_generate: fix unsetting diff flags

diff --git a/src/diff.c b/src/diff.c
index b2a5ff9..c7a6528 100644
--- a/src/diff.c
+++ b/src/diff.c
@@ -13,13 +13,6 @@
 #include "commit.h"
 #include "index.h"
 
-#define DIFF_FLAG_IS_SET(DIFF,FLAG) \
-	(((DIFF)->opts.flags & (FLAG)) != 0)
-#define DIFF_FLAG_ISNT_SET(DIFF,FLAG) \
-	(((DIFF)->opts.flags & (FLAG)) == 0)
-#define DIFF_FLAG_SET(DIFF,FLAG,VAL) (DIFF)->opts.flags = \
-	(VAL) ? ((DIFF)->opts.flags | (FLAG)) : ((DIFF)->opts.flags & ~(VAL))
-
 struct patch_id_args {
 	git_hash_ctx ctx;
 	git_oid result;
diff --git a/src/diff_generate.c b/src/diff_generate.c
index 6b3fa4f..bce2a68 100644
--- a/src/diff_generate.c
+++ b/src/diff_generate.c
@@ -24,7 +24,7 @@
 	(((DIFF)->base.opts.flags & (FLAG)) == 0)
 #define DIFF_FLAG_SET(DIFF,FLAG,VAL) (DIFF)->base.opts.flags = \
 	(VAL) ? ((DIFF)->base.opts.flags | (FLAG)) : \
-	((DIFF)->base.opts.flags & ~(VAL))
+	((DIFF)->base.opts.flags & ~(FLAG))
 
 typedef struct {
 	struct git_diff base;