aboutsummaryrefslogtreecommitdiff
path: root/wt-status.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 /wt-status.c
parent126f431ab61b250deab2b46f933a5bcd35a71c6b (diff)
downloadgit-32962c9bd5149005b163dff230670872eb99286a.tar.gz
git-32962c9bd5149005b163dff230670872eb99286a.tar.xz
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 'wt-status.c')
-rw-r--r--wt-status.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/wt-status.c b/wt-status.c
index 5807fc321..dcaec7f09 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -290,10 +290,13 @@ static void wt_status_collect_changes_worktree(struct wt_status *s)
static void wt_status_collect_changes_index(struct wt_status *s)
{
struct rev_info rev;
+ struct setup_revision_opt opt;
init_revisions(&rev, NULL);
- setup_revisions(0, NULL, &rev,
- s->is_initial ? EMPTY_TREE_SHA1_HEX : s->reference);
+ memset(&opt, 0, sizeof(opt));
+ opt.def = s->is_initial ? EMPTY_TREE_SHA1_HEX : s->reference;
+ setup_revisions(0, NULL, &rev, &opt);
+
rev.diffopt.output_format |= DIFF_FORMAT_CALLBACK;
rev.diffopt.format_callback = wt_status_collect_updated_cb;
rev.diffopt.format_callback_data = s;
@@ -512,11 +515,15 @@ static void wt_status_print_untracked(struct wt_status *s)
static void wt_status_print_verbose(struct wt_status *s)
{
struct rev_info rev;
+ struct setup_revision_opt opt;
init_revisions(&rev, NULL);
DIFF_OPT_SET(&rev.diffopt, ALLOW_TEXTCONV);
- setup_revisions(0, NULL, &rev,
- s->is_initial ? EMPTY_TREE_SHA1_HEX : s->reference);
+
+ memset(&opt, 0, sizeof(opt));
+ opt.def = s->is_initial ? EMPTY_TREE_SHA1_HEX : s->reference;
+ setup_revisions(0, NULL, &rev, &opt);
+
rev.diffopt.output_format |= DIFF_FORMAT_PATCH;
rev.diffopt.detect_rename = 1;
rev.diffopt.file = s->fp;