summaryrefslogtreecommitdiff
path: root/builtin/worktree.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin/worktree.c')
-rw-r--r--builtin/worktree.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/builtin/worktree.c b/builtin/worktree.c
index 5a9cf076ad..62b7e26f4b 100644
--- a/builtin/worktree.c
+++ b/builtin/worktree.c
@@ -1,10 +1,9 @@
-#include "cache.h"
+#include "builtin.h"
#include "abspath.h"
#include "advice.h"
#include "checkout.h"
#include "config.h"
#include "copy.h"
-#include "builtin.h"
#include "dir.h"
#include "environment.h"
#include "gettext.h"
@@ -12,8 +11,10 @@
#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"
@@ -23,7 +24,6 @@
#include "submodule.h"
#include "utf8.h"
#include "worktree.h"
-#include "wrapper.h"
#include "quote.h"
#define BUILTIN_WORKTREE_ADD_USAGE \
@@ -53,14 +53,14 @@
"(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,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)
@@ -627,10 +628,10 @@ static void print_preparing_worktree_line(int detach,
*
* Returns 0 on failure and non-zero on success.
*/
-static int first_valid_ref(const char *refname,
- const struct object_id *oid,
- int flags,
- void *cb_data)
+static int first_valid_ref(const char *refname UNUSED,
+ const struct object_id *oid UNUSED,
+ int flags UNUSED,
+ void *cb_data UNUSED)
{
return 1;
}
@@ -695,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;
}