]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'ja/worktree-orphan' into maint-2.42
authorJunio C Hamano <gitster@pobox.com>
Thu, 2 Nov 2023 07:53:21 +0000 (16:53 +0900)
committerJunio C Hamano <gitster@pobox.com>
Thu, 2 Nov 2023 07:53:21 +0000 (16:53 +0900)
Typofix in an error message.

* ja/worktree-orphan:
  builtin/worktree.c: fix typo in "forgot fetch" msg

1  2 
builtin/worktree.c

diff --combined builtin/worktree.c
index 4cd01842de79fb43b842032eeffb1a181f788c6e,2901bfd936ad8ff155d8fca3ccb3291923edd6a6..10db70b7ec910753278a8506c92ae3573ec5c216
@@@ -1,29 -1,25 +1,29 @@@
 -#include "cache.h"
 +#include "builtin.h"
  #include "abspath.h"
  #include "advice.h"
  #include "checkout.h"
  #include "config.h"
 -#include "builtin.h"
 +#include "copy.h"
  #include "dir.h"
  #include "environment.h"
  #include "gettext.h"
  #include "hex.h"
 +#include "object-file.h"
 +#include "object-name.h"
  #include "parse-options.h"
 +#include "path.h"
  #include "strvec.h"
  #include "branch.h"
 +#include "read-cache-ll.h"
  #include "refs.h"
  #include "remote.h"
 +#include "repository.h"
  #include "run-command.h"
  #include "hook.h"
  #include "sigchain.h"
  #include "submodule.h"
  #include "utf8.h"
  #include "worktree.h"
 -#include "wrapper.h"
  #include "quote.h"
  
  #define BUILTIN_WORKTREE_ADD_USAGE \
        "(branch with no commits) for this repository, you can do so\n" \
        "using the --orphan flag:\n" \
        "\n" \
 -      "       git worktree add --orphan -b %s %s\n")
 +      "    git worktree add --orphan -b %s %s\n")
  
  #define WORKTREE_ADD_ORPHAN_NO_DASH_B_HINT_TEXT \
        _("If you meant to create a worktree containing a new orphan branch\n" \
        "(branch with no commits) for this repository, you can do so\n" \
        "using the --orphan flag:\n" \
        "\n" \
 -      "       git worktree add --orphan %s\n")
 +      "    git worktree add --orphan %s\n")
  
  static const char * const git_worktree_usage[] = {
        BUILTIN_WORKTREE_ADD_USAGE,
@@@ -128,15 -124,14 +128,15 @@@ static int verbose
  static int guess_remote;
  static timestamp_t expire;
  
 -static int git_worktree_config(const char *var, const char *value, void *cb)
 +static int git_worktree_config(const char *var, const char *value,
 +                             const struct config_context *ctx, void *cb)
  {
        if (!strcmp(var, "worktree.guessremote")) {
                guess_remote = git_config_bool(var, value);
                return 0;
        }
  
 -      return git_default_config(var, value, cb);
 +      return git_default_config(var, value, ctx, cb);
  }
  
  static int delete_git_dir(const char *id)
@@@ -521,7 -516,7 +521,7 @@@ static int add_worktree(const char *pat
         * values from the current worktree into the new one, that way the
         * new worktree behaves the same as this one.
         */
 -      if (repository_format_worktree_config)
 +      if (the_repository->repository_format_worktree_config)
                copy_filtered_worktree_config(sb_repo.buf);
  
        strvec_pushf(&child_env, "%s=%s", GIT_DIR_ENVIRONMENT, sb_git.buf);
@@@ -696,7 -691,7 +696,7 @@@ static int can_use_remote_refs(const st
                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;
  }
@@@ -1408,9 -1403,5 +1408,9 @@@ int cmd_worktree(int ac, const char **a
                prefix = "";
  
        ac = parse_options(ac, av, prefix, options, git_worktree_usage, 0);
 +
 +      prepare_repo_settings(the_repository);
 +      the_repository->settings.command_requires_full_index = 0;
 +
        return fn(ac, av, prefix);
  }