diff options
Diffstat (limited to 'scalar.c')
| -rw-r--r-- | scalar.c | 17 |
1 files changed, 12 insertions, 5 deletions
@@ -3,6 +3,7 @@ */ #include "cache.h" +#include "abspath.h" #include "gettext.h" #include "parse-options.h" #include "config.h" @@ -14,6 +15,7 @@ #include "dir.h" #include "packfile.h" #include "help.h" +#include "setup.h" static void setup_enlistment_directory(int argc, const char **argv, const char * const *usagestr, @@ -143,6 +145,7 @@ static int set_recommended_config(int reconfigure) { "credential.validate", "false", 1 }, /* GCM4W-only */ { "gc.auto", "0", 1 }, { "gui.GCWarning", "false", 1 }, + { "index.skipHash", "false", 1 }, { "index.threads", "true", 1 }, { "index.version", "4", 1 }, { "merge.stat", "false", 1 }, @@ -261,7 +264,7 @@ static int register_dir(void) return error(_("could not set recommended config")); if (toggle_maintenance(1)) - return error(_("could not turn on maintenance")); + warning(_("could not turn on maintenance")); if (have_fsmonitor_support() && start_fsmonitor_daemon()) { return error(_("could not start the FSMonitor daemon")); @@ -404,7 +407,7 @@ void load_builtin_commands(const char *prefix, struct cmdnames *cmds) static int cmd_clone(int argc, const char **argv) { const char *branch = NULL; - int full_clone = 0, single_branch = 0; + int full_clone = 0, single_branch = 0, show_progress = isatty(2); struct option clone_options[] = { OPT_STRING('b', "branch", &branch, N_("<branch>"), N_("branch to checkout after clone")), @@ -499,7 +502,9 @@ static int cmd_clone(int argc, const char **argv) if (set_recommended_config(0)) return error(_("could not configure '%s'"), dir); - if ((res = run_git("fetch", "--quiet", "origin", NULL))) { + if ((res = run_git("fetch", "--quiet", + show_progress ? "--progress" : "--no-progress", + "origin", NULL))) { warning(_("partial clone failed; attempting full clone")); if (set_config("remote.origin.promisor") || @@ -508,7 +513,9 @@ static int cmd_clone(int argc, const char **argv) goto cleanup; } - if ((res = run_git("fetch", "--quiet", "origin", NULL))) + if ((res = run_git("fetch", "--quiet", + show_progress ? "--progress" : "--no-progress", + "origin", NULL))) goto cleanup; } @@ -558,7 +565,7 @@ static int cmd_diagnose(int argc, const char **argv) return res; } -static int cmd_list(int argc, const char **argv) +static int cmd_list(int argc, const char **argv UNUSED) { if (argc != 1) die(_("`scalar list` does not take arguments")); |
