RESEND [PATCH v10 7/8] worktree add: extend DWIM to infer --orphan
From: Teng Long <hidden>
Date: 2023-08-09 06:47:43
Subsystem:
the rest · Maintainer:
Linus Torvalds
From: Teng Long <hidden>
Date: 2023-08-09 06:47:43
Subsystem:
the rest · Maintainer:
Linus Torvalds
+static int can_use_remote_refs(const struct add_opts *opts)
+{
+ if (!guess_remote) {
+ if (!opts->quiet)
+ fprintf_ln(stderr, WORKTREE_ADD_DWIM_ORPHAN_INFER_TEXT);
+ return 0;
+ } else if (for_each_remote_ref(first_valid_ref, NULL)) {
+ return 1;
+ } else if (!opts->force && remote_get(NULL)) {
+ die(_("No local or remote refs exist despite at least one remote\n"
+ "present, stopping; use 'add -f' to overide or fetch a remote first"));
+ } else if (!opts->quiet) {
+ fprintf_ln(stderr, WORKTREE_ADD_DWIM_ORPHAN_INFER_TEXT);
+ }
+ return 0;
+}s/overide/override? builtin/worktree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/builtin/worktree.c b/builtin/worktree.c
index 4cd01842..10db70b7 100644
--- a/builtin/worktree.c
+++ b/builtin/worktree.c@@ -696,7 +696,7 @@ static int can_use_remote_refs(const struct add_opts *opts) return 1; } else if (!opts->force && remote_get(NULL)) { die(_("No local or remote refs exist despite at least one remote\n" - "present, stopping; use 'add -f' to overide or fetch a remote first")); + "present, stopping; use 'add -f' to override or fetch a remote first")); } return 0; } ---
I found it when working at l10n round of 2.42.0, maybe it's not late to fix this typo: Thanks.