summaryrefslogtreecommitdiff
path: root/revision.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 /revision.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 'revision.c')
-rw-r--r--revision.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/revision.c b/revision.c
index 3ba6d991f6..25c1bbb9a6 100644
--- a/revision.c
+++ b/revision.c
@@ -1328,7 +1328,7 @@ static void append_prune_data(const char ***prune_data, const char **av)
* Returns the number of arguments left that weren't recognized
* (which are also moved to the head of the argument list)
*/
-int setup_revisions(int argc, const char **argv, struct rev_info *revs, const char *def)
+int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct setup_revision_opt *opt)
{
int i, flags, left, seen_dashdash, read_from_stdin;
const char **prune_data = NULL;
@@ -1462,7 +1462,7 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
revs->prune_data = get_pathspec(revs->prefix, prune_data);
if (revs->def == NULL)
- revs->def = def;
+ revs->def = opt ? opt->def : NULL;
if (revs->show_merge)
prepare_show_merge(revs);
if (revs->def && !revs->pending.nr) {