summaryrefslogtreecommitdiff
path: root/revision.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-06-02 18:34:01 -0700
committerJunio C Hamano <gitster@pobox.com>2009-06-03 00:49:50 -0700
commitceff8e7adeed51024491deb4933f23db760e5641 (patch)
treec98b5de12111a6767b45f8e9f5f65ef7d1bb7299 /revision.h
parent433e972aeb5e485d2f7a7ac605a1c043822e25d9 (diff)
downloadgit-ceff8e7adeed51024491deb4933f23db760e5641.tar.gz
Clean up and simplify rev_compare_tree()
This simplifies the logic of rev_compare_tree() by removing a special case. It does so by turning the special case of finding a diff to be "all new files" into a more generic case of "all new" vs "all removed" vs "mixed changes", so now the code is actually more powerful and more generic, and the added symmetry actually makes it simpler too. This makes no changes to any existing behavior, but apart from the simplification it does make it possible to some day care about whether all changes were just deletions if we want to. Which we may well want to for merge handling. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'revision.h')
-rw-r--r--revision.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/revision.h b/revision.h
index be39e7d386..227164cf70 100644
--- a/revision.h
+++ b/revision.h
@@ -118,8 +118,9 @@ struct rev_info {
};
#define REV_TREE_SAME 0
-#define REV_TREE_NEW 1
-#define REV_TREE_DIFFERENT 2
+#define REV_TREE_NEW 1 /* Only new files */
+#define REV_TREE_OLD 2 /* Only files removed */
+#define REV_TREE_DIFFERENT 3 /* Mixed changes */
/* revision.c */
void read_revisions_from_stdin(struct rev_info *revs);