summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
Diffstat (limited to 'builtin')
-rw-r--r--builtin/clone.c5
-rw-r--r--builtin/difftool.c13
-rw-r--r--builtin/multi-pack-index.c2
-rw-r--r--builtin/pack-objects.c2
-rw-r--r--builtin/pack-refs.c2
-rw-r--r--builtin/show-ref.c3
-rw-r--r--builtin/submodule--helper.c2
-rw-r--r--builtin/tag.c2
8 files changed, 15 insertions, 16 deletions
diff --git a/builtin/clone.c b/builtin/clone.c
index ffdd94e8f6..85b0d3155d 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -99,10 +99,7 @@ static struct option builtin_clone_options[] = {
N_("don't use local hardlinks, always copy")),
OPT_BOOL('s', "shared", &option_shared,
N_("setup as shared repository")),
- { OPTION_CALLBACK, 0, "recursive", &option_recurse_submodules,
- N_("pathspec"), N_("initialize submodules in the clone"),
- PARSE_OPT_OPTARG | PARSE_OPT_HIDDEN, recurse_submodules_cb,
- (intptr_t)"." },
+ OPT_ALIAS(0, "recursive", "recurse-submodules"),
{ OPTION_CALLBACK, 0, "recurse-submodules", &option_recurse_submodules,
N_("pathspec"), N_("initialize submodules in the clone"),
PARSE_OPT_OPTARG, recurse_submodules_cb, (intptr_t)"." },
diff --git a/builtin/difftool.c b/builtin/difftool.c
index 04ffa1d943..53188df714 100644
--- a/builtin/difftool.c
+++ b/builtin/difftool.c
@@ -24,7 +24,6 @@
#include "object-store.h"
#include "dir.h"
-static char *diff_gui_tool;
static int trust_exit_code;
static const char *const builtin_difftool_usage[] = {
@@ -34,11 +33,6 @@ static const char *const builtin_difftool_usage[] = {
static int difftool_config(const char *var, const char *value, void *cb)
{
- if (!strcmp(var, "diff.guitool")) {
- diff_gui_tool = xstrdup(value);
- return 0;
- }
-
if (!strcmp(var, "difftool.trustexitcode")) {
trust_exit_code = git_config_bool(var, value);
return 0;
@@ -735,8 +729,11 @@ int cmd_difftool(int argc, const char **argv, const char *prefix)
setenv(GIT_WORK_TREE_ENVIRONMENT, absolute_path(get_git_work_tree()), 1);
}
- if (use_gui_tool && diff_gui_tool && *diff_gui_tool)
- setenv("GIT_DIFF_TOOL", diff_gui_tool, 1);
+ if (use_gui_tool + !!difftool_cmd + !!extcmd > 1)
+ die(_("--gui, --tool and --extcmd are mutually exclusive"));
+
+ if (use_gui_tool)
+ setenv("GIT_MERGETOOL_GUI", "true", 1);
else if (difftool_cmd) {
if (*difftool_cmd)
setenv("GIT_DIFF_TOOL", difftool_cmd, 1);
diff --git a/builtin/multi-pack-index.c b/builtin/multi-pack-index.c
index ae6e476ad5..72dfd3dadc 100644
--- a/builtin/multi-pack-index.c
+++ b/builtin/multi-pack-index.c
@@ -46,7 +46,7 @@ int cmd_multi_pack_index(int argc, const char **argv,
if (!strcmp(argv[0], "write"))
return write_midx_file(opts.object_dir);
if (!strcmp(argv[0], "verify"))
- return verify_midx_file(opts.object_dir);
+ return verify_midx_file(the_repository, opts.object_dir);
die(_("unrecognized verb: %s"), argv[0]);
}
diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
index 9f424aabab..41d7fc5983 100644
--- a/builtin/pack-objects.c
+++ b/builtin/pack-objects.c
@@ -1080,7 +1080,7 @@ static int want_object_in_pack(const struct object_id *oid,
for (m = get_multi_pack_index(the_repository); m; m = m->next) {
struct pack_entry e;
- if (fill_midx_entry(oid, &e, m)) {
+ if (fill_midx_entry(the_repository, oid, &e, m)) {
struct packed_git *p = e.p;
off_t offset;
diff --git a/builtin/pack-refs.c b/builtin/pack-refs.c
index f3353564f9..cfbd5c36c7 100644
--- a/builtin/pack-refs.c
+++ b/builtin/pack-refs.c
@@ -1,4 +1,5 @@
#include "builtin.h"
+#include "config.h"
#include "parse-options.h"
#include "refs.h"
#include "repository.h"
@@ -16,6 +17,7 @@ int cmd_pack_refs(int argc, const char **argv, const char *prefix)
OPT_BIT(0, "prune", &flags, N_("prune loose refs (default)"), PACK_REFS_PRUNE),
OPT_END(),
};
+ git_config(git_default_config, NULL);
if (parse_options(argc, argv, prefix, opts, pack_refs_usage, 0))
usage_with_options(pack_refs_usage, opts);
return refs_pack_refs(get_main_ref_store(the_repository), flags);
diff --git a/builtin/show-ref.c b/builtin/show-ref.c
index 6a706c02a6..6456da70cc 100644
--- a/builtin/show-ref.c
+++ b/builtin/show-ref.c
@@ -1,5 +1,6 @@
#include "builtin.h"
#include "cache.h"
+#include "config.h"
#include "refs.h"
#include "object-store.h"
#include "object.h"
@@ -182,6 +183,8 @@ static const struct option show_ref_options[] = {
int cmd_show_ref(int argc, const char **argv, const char *prefix)
{
+ git_config(git_default_config, NULL);
+
argc = parse_options(argc, argv, prefix, show_ref_options,
show_ref_usage, 0);
diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c
index 8c72ea864c..0bf4aa088e 100644
--- a/builtin/submodule--helper.c
+++ b/builtin/submodule--helper.c
@@ -1301,7 +1301,7 @@ static int add_possible_reference_from_superproject(
die(_("submodule '%s' cannot add alternate: %s"),
sas->submodule_name, err.buf);
case SUBMODULE_ALTERNATE_ERROR_INFO:
- fprintf(stderr, _("submodule '%s' cannot add alternate: %s"),
+ fprintf_ln(stderr, _("submodule '%s' cannot add alternate: %s"),
sas->submodule_name, err.buf);
case SUBMODULE_ALTERNATE_ERROR_IGNORE:
; /* nothing */
diff --git a/builtin/tag.c b/builtin/tag.c
index 1debd3a11c..ef37dccf86 100644
--- a/builtin/tag.c
+++ b/builtin/tag.c
@@ -207,7 +207,7 @@ struct create_tag_options {
};
static const char message_advice_nested_tag[] =
- N_("You have created a nested tag. The object referred to by your new is\n"
+ N_("You have created a nested tag. The object referred to by your new tag is\n"
"already a tag. If you meant to tag the object that it points to, use:\n"
"\n"
"\tgit tag -f %s %s^{}");