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:
authorJunio C Hamano <gitster@pobox.com>2020-05-09 00:25:08 +0300
committerJunio C Hamano <gitster@pobox.com>2020-05-09 00:25:08 +0300
commit4c2941a5fa6c99cb204c48d2fe6f3b55a7211012 (patch)
treed82509c96a7eeb7260cbd46c423f4b1d978ac04b /builtin/checkout.c
parent6d4bf5813cd2c1a3b93fd4f0b231733f82133cce (diff)
parent088018e34d705aad696acfeb624cfe5552ba256f (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/checkout.c')
-rw-r--r--builtin/checkout.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/builtin/checkout.c b/builtin/checkout.c
index 91d9e88b05d..e9d111bb836 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";
/*