Provide git_config with a callback-data parameter
[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[] =
4551d05f 13"git-diff-files [-q] [-0/-1/2/3 |-c|--cc|--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;
af05d679 19 int nongit;
41bbf9d5 20 int result;
e83c5163 21
d516c2d1 22 prefix = setup_git_directory_gently(&nongit);
a633fca0 23 init_revisions(&rev, prefix);
ef90d6d4 24 git_config(git_diff_basic_config, NULL); /* no "diff" UI options */
6973dcae
JH
25 rev.abbrev = 0;
26
fcfa33ec
JS
27 if (!setup_diff_no_index(&rev, argc, argv, nongit, prefix))
28 argc = 0;
29 else
30 argc = setup_revisions(argc, argv, &rev, NULL);
c9b5ef99
TH
31 if (!rev.diffopt.output_format)
32 rev.diffopt.output_format = DIFF_FORMAT_RAW;
41bbf9d5 33 result = run_diff_files_cmd(&rev, argc, argv);
da31b358 34 return diff_result_code(&rev.diffopt, result);
e83c5163 35}