summaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-05-29 16:56:13 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-05-30 10:35:49 -0700
commitbefe86392c767b62e4a6498cf951faae6f2c5ea3 (patch)
tree773e4f15fd5652983309b27c5f22dd29899cb749 /diff.c
parentddafa7e93325d45cd4bd950dd8e89ff3188d0250 (diff)
downloadgit-befe86392c767b62e4a6498cf951faae6f2c5ea3.tar.gz
[PATCH] diff: consolidate various calls into diffcore.
The three diff-* brothers had a sequence of calls into diffcore that were almost identical. Introduce a new diffcore_std() function that takes all the necessary arguments to consolidate it. This will make later enhancements and changing the order of diffcore application simpler. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/diff.c b/diff.c
index 357c4efce1..68e7db8667 100644
--- a/diff.c
+++ b/diff.c
@@ -887,6 +887,18 @@ void diff_flush(int diff_output_style, int resolve_rename_copy)
q->nr = q->alloc = 0;
}
+void diffcore_std(const char **paths,
+ int detect_rename, int rename_score,
+ const char *pickaxe, int pickaxe_opts)
+{
+ if (paths && paths[0])
+ diffcore_pathspec(paths);
+ if (detect_rename)
+ diffcore_rename(detect_rename, rename_score);
+ if (pickaxe)
+ diffcore_pickaxe(pickaxe, pickaxe_opts);
+}
+
void diff_addremove(int addremove, unsigned mode,
const unsigned char *sha1,
const char *base, const char *path)