# [PATCH] Use macro define to replace magic character

1 messages from 2011-11-18 to 2011-11-18. Participants: Zheng Liu.
Thread: https://gitlist.dev/t/28967

## Zheng Liu, 2011-11-18 01:43

Subject: [PATCH] Use macro define to replace magic character
Message-ID: <1321580586-19247-1-git-send-email-wenqing.lz@taobao.com>
URL: https://gitlist.dev/e/1321580586-19247-1-git-send-email-wenqing.lz%40taobao.com

```
We should use macro define rather than magic character to make more readable

Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
---
 merge-recursive.c |    2 +-
 tree-diff.c       |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/merge-recursive.c b/merge-recursive.c
index cc664c3..96457bc 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -503,7 +503,7 @@ static struct string_list *get_renames(struct merge_options *o,
 		struct string_list_item *item;
 		struct rename *re;
 		struct diff_filepair *pair = diff_queued_diff.queue[i];
-		if (pair->status != 'R') {
+		if (pair->status != DIFF_STATUS_RENAMED) {
 			diff_free_filepair(pair);
 			continue;
 		}
diff --git a/tree-diff.c b/tree-diff.c
index b3cc2e4..d52c440 100644
--- a/tree-diff.c
+++ b/tree-diff.c
@@ -225,7 +225,7 @@ static void try_to_follow_renames(struct tree_desc *t1, struct tree_desc *t2, co
 		 * diff_queued_diff, we will also use that as the path in
 		 * the future!
 		 */
-		if ((p->status == 'R' || p->status == 'C') &&
+		if ((p->status == DIFF_STATUS_RENAMED || p->status == DIFF_STATUS_COPIED) &&
 		    !strcmp(p->two->path, opt->pathspec.raw[0])) {
 			/* Switch the file-pairs around */
 			q->queue[i] = choice;
-- 
1.7.5.4

```
