[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>
This commit is contained in:
Junio C Hamano
2005-05-29 16:56:13 -07:00
committed by Linus Torvalds
parent ddafa7e933
commit befe86392c
5 changed files with 25 additions and 16 deletions

12
diff.c
View File

@ -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)