diff options
author | Junio C Hamano <gitster@pobox.com> | 2019-02-08 20:44:51 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-02-08 20:44:51 -0800 |
commit | 87c9831df0f5ae4e96ab2e5b9b5b50505baa8cf4 (patch) | |
tree | cc10db1474240fda9cd1cb19287ec7e3ba235c8c /builtin/checkout.c | |
parent | fd357c4270ea4b48e95fb475fdc9b6ce2ee447e1 (diff) | |
parent | 1d1f689bef77b1bd0cb0f0bc0e0bd766283c5df8 (diff) | |
download | git-87c9831df0f5ae4e96ab2e5b9b5b50505baa8cf4.tar.gz |
Merge branch 'nd/checkout-noisy-unmerge'
"git checkout [<tree-ish>] <pathspec>" started reporting the number
of paths that have got updated recently, but the same messages were
given when "git checkout -m <pathspec>" to unresolve conflicts that
have just been resolved. The message now reports these unresolved
paths separately from the paths that are checked out from the index.
* nd/checkout-noisy-unmerge:
checkout: count and print -m paths separately
checkout: update count-checkouts messages
Diffstat (limited to 'builtin/checkout.c')
-rw-r--r-- | builtin/checkout.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/builtin/checkout.c b/builtin/checkout.c index ece4eb14bf..24b8593b93 100644 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@ -261,7 +261,7 @@ static int checkout_paths(const struct checkout_opts *opts, struct commit *head; int errs = 0; struct lock_file lock_file = LOCK_INIT; - int nr_checkouts = 0; + int nr_checkouts = 0, nr_unmerged = 0; if (opts->track != BRANCH_TRACK_UNSPECIFIED) die(_("'%s' cannot be used with updating paths"), "--track"); @@ -386,23 +386,28 @@ static int checkout_paths(const struct checkout_opts *opts, &state, &nr_checkouts); else if (opts->merge) errs |= checkout_merged(pos, &state, - &nr_checkouts); + &nr_unmerged); pos = skip_same_name(ce, pos) - 1; } } errs |= finish_delayed_checkout(&state, &nr_checkouts); if (opts->count_checkout_paths) { + if (nr_unmerged) + fprintf_ln(stderr, Q_("Recreated %d merge conflict", + "Recreated %d merge conflicts", + nr_unmerged), + nr_unmerged); if (opts->source_tree) - fprintf_ln(stderr, Q_("Checked out %d path out of %s", - "Checked out %d paths out of %s", + fprintf_ln(stderr, Q_("Updated %d path from %s", + "Updated %d paths from %s", nr_checkouts), nr_checkouts, find_unique_abbrev(&opts->source_tree->object.oid, DEFAULT_ABBREV)); - else - fprintf_ln(stderr, Q_("Checked out %d path out of the index", - "Checked out %d paths out of the index", + else if (!nr_unmerged || nr_checkouts) + fprintf_ln(stderr, Q_("Updated %d path from the index", + "Updated %d paths from the index", nr_checkouts), nr_checkouts); } |