]> git.ipfire.org Git - thirdparty/git.git/blame - builtin-diff-files.c
Fix a test failure (t9500-*.sh) on cygwin
[thirdparty/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;
d516c2d1 19 int nongit = 0;
41bbf9d5 20 int result;
e83c5163 21
d516c2d1 22 prefix = setup_git_directory_gently(&nongit);
a633fca0 23 init_revisions(&rev, prefix);
ef1d9c5a 24 git_config(git_default_config); /* 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
AR
33 result = run_diff_files_cmd(&rev, argc, argv);
34 return rev.diffopt.exit_with_status ? rev.diffopt.has_changes: result;
e83c5163 35}