threads / patch / 28967

patchUse macro define to replace magic character

Subject: [PATCH] Use macro define to replace magic character

## tl;dr

One message between Nov 18, 2011 and Nov 18, 2011. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Zheng Liu· Nov 18, 2011, 01:43 UTC · lore
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(-)
Show changes to 2 files +2 −2

merge-recursive.c, tree-diff.c

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

← back to recent threads