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>
This commit is contained in:
Junio C Hamano
2010-03-08 22:58:09 -08:00
parent 126f431ab6
commit 32962c9bd5
5 changed files with 44 additions and 16 deletions

View File

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