diff options
author | Junio C Hamano <gitster@pobox.com> | 2020-05-09 00:25:08 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-05-09 00:25:08 +0300 |
commit | 4c2941a5fa6c99cb204c48d2fe6f3b55a7211012 (patch) | |
tree | d82509c96a7eeb7260cbd46c423f4b1d978ac04b /builtin | |
parent | 6d4bf5813cd2c1a3b93fd4f0b231733f82133cce (diff) | |
parent | 088018e34d705aad696acfeb624cfe5552ba256f (diff) |
Merge branch 'es/restore-staged-from-head-by-default'
"git restore --staged --worktree" now defaults to take the contents
out of "HEAD", instead of erring out.
* es/restore-staged-from-head-by-default:
restore: default to HEAD when combining --staged and --worktree
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/checkout.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/builtin/checkout.c b/builtin/checkout.c index 91d9e88b05..e9d111bb83 100644 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@ -1609,10 +1609,10 @@ static int checkout_main(int argc, const char **argv, const char *prefix, if (opts->checkout_index < 0 || opts->checkout_worktree < 0) BUG("these flags should be non-negative by now"); /* - * convenient shortcut: "git restore --staged" equals - * "git restore --staged --source HEAD" + * convenient shortcut: "git restore --staged [--worktree]" equals + * "git restore --staged [--worktree] --source HEAD" */ - if (!opts->from_treeish && opts->checkout_index && !opts->checkout_worktree) + if (!opts->from_treeish && opts->checkout_index) opts->from_treeish = "HEAD"; /* |