From 6586b1f3465a93e908664ea24fa2f5ff47a587e3 Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Mon, 9 Nov 2009 09:04:47 -0600 Subject: [PATCH 1/3] check-ref-format: update usage string 'git check-ref-format' has learned --branch and --print options since the usage string was last updated. Signed-off-by: Jonathan Nieder Signed-off-by: Junio C Hamano --- builtin-check-ref-format.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/builtin-check-ref-format.c b/builtin-check-ref-format.c index f9381e07ea..96382e3447 100644 --- a/builtin-check-ref-format.c +++ b/builtin-check-ref-format.c @@ -7,6 +7,10 @@ #include "builtin.h" #include "strbuf.h" +static const char builtin_check_ref_format_usage[] = +"git check-ref-format [--print] \n" +" or: git check-ref-format --branch "; + int cmd_check_ref_format(int argc, const char **argv, const char *prefix) { if (argc == 3 && !strcmp(argv[1], "--branch")) { @@ -18,6 +22,6 @@ int cmd_check_ref_format(int argc, const char **argv, const char *prefix) exit(0); } if (argc != 2) - usage("git check-ref-format refname"); + usage(builtin_check_ref_format_usage); return !!check_ref_format(argv[1]); } From d629c40b0b8b63b0c8b33d52dcba0ed202d898d7 Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Mon, 9 Nov 2009 09:04:58 -0600 Subject: [PATCH 2/3] merge: do not setup worktree twice Builtins do not need to run setup_worktree() for themselves, since the builtin machinery runs it for them. Signed-off-by: Jonathan Nieder Signed-off-by: Junio C Hamano --- builtin-merge.c | 1 - 1 file changed, 1 deletion(-) diff --git a/builtin-merge.c b/builtin-merge.c index b6b84286b2..e95c5dc717 100644 --- a/builtin-merge.c +++ b/builtin-merge.c @@ -840,7 +840,6 @@ int cmd_merge(int argc, const char **argv, const char *prefix) const char *best_strategy = NULL, *wt_strategy = NULL; struct commit_list **remotes = &remoteheads; - setup_work_tree(); if (file_exists(git_path("MERGE_HEAD"))) die("You have not concluded your merge. (MERGE_HEAD exists)"); if (read_cache_unmerged()) From f01d74960363736caaf4d98d39555e99bdc72c25 Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Mon, 9 Nov 2009 09:05:00 -0600 Subject: [PATCH 3/3] http-fetch: add missing initialization of argv0_path According to c6dfb39 (remote-curl: add missing initialization of argv0_path, 2009-10-13), programs with "main" must call this to work correctly on MinGW. Signed-off-by: Jonathan Nieder Signed-off-by: Junio C Hamano --- http-fetch.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/http-fetch.c b/http-fetch.c index e8f44babd9..88f7dc8845 100644 --- a/http-fetch.c +++ b/http-fetch.c @@ -1,4 +1,5 @@ #include "cache.h" +#include "exec_cmd.h" #include "walker.h" int main(int argc, const char **argv) @@ -19,8 +20,8 @@ int main(int argc, const char **argv) int get_verbosely = 0; int get_recover = 0; + git_extract_argv0_path(argv[0]); prefix = setup_git_directory(); - git_config(git_default_config, NULL); while (arg < argc && argv[arg][0] == '-') {