Merge branch 'np/types'
[git/git.git] / builtin-diff-files.c
CommitLineData
8bc9a0c7
LT
1/*
2 * GIT - The information manager from hell
3 *
4 * Copyright (C) Linus Torvalds, 2005
5 */
e83c5163 6#include "cache.h"
4a6bf9e1 7#include "diff.h"
91539833
LT
8#include "commit.h"
9#include "revision.h"
e8cc9cd9 10#include "builtin.h"
c0fb976a 11
4d1f1190 12static const char diff_files_usage[] =
d516c2d1 13"git-diff-files [-q] [-0/-1/2/3 |-c|--cc|-n|--no-index] [<common diff options>] [<path>...]"
dda2d79a 14COMMON_DIFF_OPTIONS_HELP;
b8f80925 15
a633fca0 16int cmd_diff_files(int argc, const char **argv, const char *prefix)
e83c5163 17{
6973dcae 18 struct rev_info rev;
d516c2d1 19 int nongit = 0;
e83c5163 20
d516c2d1 21 prefix = setup_git_directory_gently(&nongit);
a633fca0 22 init_revisions(&rev, prefix);
ef1d9c5a 23 git_config(git_default_config); /* no "diff" UI options */
6973dcae
JH
24 rev.abbrev = 0;
25
26 argc = setup_revisions(argc, argv, &rev, NULL);
c9b5ef99
TH
27 if (!rev.diffopt.output_format)
28 rev.diffopt.output_format = DIFF_FORMAT_RAW;
d516c2d1 29 return run_diff_files_cmd(&rev, argc, argv);
e83c5163 30}