Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'wt-status.c')
-rw-r--r--wt-status.c26
1 files changed, 19 insertions, 7 deletions
diff --git a/wt-status.c b/wt-status.c
index c29e4bf091a..dd5270647ec 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -179,9 +179,15 @@ static void wt_longstatus_print_unmerged_header(struct wt_status *s)
return;
if (s->whence != FROM_COMMIT)
;
- else if (!s->is_initial)
- status_printf_ln(s, c, _(" (use \"git reset %s <file>...\" to unstage)"), s->reference);
- else
+ else if (!s->is_initial) {
+ if (!strcmp(s->reference, "HEAD"))
+ status_printf_ln(s, c,
+ _(" (use \"git restore --staged <file>...\" to unstage)"));
+ else
+ status_printf_ln(s, c,
+ _(" (use \"git restore --source=%s --staged <file>...\" to unstage)"),
+ s->reference);
+ } else
status_printf_ln(s, c, _(" (use \"git rm --cached <file>...\" to unstage)"));
if (!both_deleted) {
@@ -206,9 +212,15 @@ static void wt_longstatus_print_cached_header(struct wt_status *s)
return;
if (s->whence != FROM_COMMIT)
; /* NEEDSWORK: use "git reset --unresolve"??? */
- else if (!s->is_initial)
- status_printf_ln(s, c, _(" (use \"git reset %s <file>...\" to unstage)"), s->reference);
- else
+ else if (!s->is_initial) {
+ if (!strcmp(s->reference, "HEAD"))
+ status_printf_ln(s, c
+ , _(" (use \"git restore --staged <file>...\" to unstage)"));
+ else
+ status_printf_ln(s, c,
+ _(" (use \"git restore --source=%s --staged <file>...\" to unstage)"),
+ s->reference);
+ } else
status_printf_ln(s, c, _(" (use \"git rm --cached <file>...\" to unstage)"));
status_printf_ln(s, c, "%s", "");
}
@@ -226,7 +238,7 @@ static void wt_longstatus_print_dirty_header(struct wt_status *s,
status_printf_ln(s, c, _(" (use \"git add <file>...\" to update what will be committed)"));
else
status_printf_ln(s, c, _(" (use \"git add/rm <file>...\" to update what will be committed)"));
- status_printf_ln(s, c, _(" (use \"git checkout -- <file>...\" to discard changes in working directory)"));
+ status_printf_ln(s, c, _(" (use \"git restore <file>...\" to discard changes in working directory)"));
if (has_dirty_submodules)
status_printf_ln(s, c, _(" (commit or discard the untracked or modified content in submodules)"));
status_printf_ln(s, c, "%s", "");