summaryrefslogtreecommitdiff
path: root/diff-lib.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-03-08 22:58:09 -0800
committerJunio C Hamano <gitster@pobox.com>2010-03-09 01:11:18 -0800
commit32962c9bd5149005b163dff230670872eb99286a (patch)
tree8bc0322fbc0d51a26a7fb9b6bd2d08f39bdacc30 /diff-lib.c
parent126f431ab61b250deab2b46f933a5bcd35a71c6b (diff)
downloadgit-32962c9bd5149005b163dff230670872eb99286a.tar.gz
revision: introduce setup_revision_opt
So far the last parameter to setup_revisions() was to specify the default ref when the command line did not give any (typically "HEAD"). This changes it to take a pointer to a structure so that we can add other information without touching too many codepaths in later patches. There is no functionality change. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'diff-lib.c')
-rw-r--r--diff-lib.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/diff-lib.c b/diff-lib.c
index d7e13cb177..64976f921d 100644
--- a/diff-lib.c
+++ b/diff-lib.c
@@ -510,9 +510,12 @@ int do_diff_cache(const unsigned char *tree_sha1, struct diff_options *opt)
int index_differs_from(const char *def, int diff_flags)
{
struct rev_info rev;
+ struct setup_revision_opt opt;
init_revisions(&rev, NULL);
- setup_revisions(0, NULL, &rev, def);
+ memset(&opt, 0, sizeof(opt));
+ opt.def = def;
+ setup_revisions(0, NULL, &rev, &opt);
DIFF_OPT_SET(&rev.diffopt, QUICK);
DIFF_OPT_SET(&rev.diffopt, EXIT_WITH_STATUS);
rev.diffopt.flags |= diff_flags;