зеркало из https://github.com/microsoft/git.git
Merge branch 'jk/common-main' into maint
There are certain house-keeping tasks that need to be performed at the very beginning of any Git program, and programs that are not built-in commands had to do them exactly the same way as "git" potty does. It was easy to make mistakes in one-off standalone programs (like test helpers). A common "main()" function that calls cmd_main() of individual program has been introduced to make it harder to make mistakes. * jk/common-main: mingw: declare main()'s argv as const common-main: call git_setup_gettext() common-main: call restore_sigpipe_to_default() common-main: call sanitize_stdfds() common-main: call git_extract_argv0_path() add an extra level of indirection to main()
This commit is contained in:
Коммит
faacc8efe5
17
Makefile
17
Makefile
|
@ -939,7 +939,7 @@ BUILTIN_OBJS += builtin/verify-tag.o
|
||||||
BUILTIN_OBJS += builtin/worktree.o
|
BUILTIN_OBJS += builtin/worktree.o
|
||||||
BUILTIN_OBJS += builtin/write-tree.o
|
BUILTIN_OBJS += builtin/write-tree.o
|
||||||
|
|
||||||
GITLIBS = $(LIB_FILE) $(XDIFF_LIB)
|
GITLIBS = common-main.o $(LIB_FILE) $(XDIFF_LIB)
|
||||||
EXTLIBS =
|
EXTLIBS =
|
||||||
|
|
||||||
GIT_USER_AGENT = git/$(GIT_VERSION)
|
GIT_USER_AGENT = git/$(GIT_VERSION)
|
||||||
|
@ -1572,7 +1572,15 @@ TCLTK_PATH_SQ = $(subst ','\'',$(TCLTK_PATH))
|
||||||
DIFF_SQ = $(subst ','\'',$(DIFF))
|
DIFF_SQ = $(subst ','\'',$(DIFF))
|
||||||
PERLLIB_EXTRA_SQ = $(subst ','\'',$(PERLLIB_EXTRA))
|
PERLLIB_EXTRA_SQ = $(subst ','\'',$(PERLLIB_EXTRA))
|
||||||
|
|
||||||
LIBS = $(GITLIBS) $(EXTLIBS)
|
# We must filter out any object files from $(GITLIBS),
|
||||||
|
# as it is typically used like:
|
||||||
|
#
|
||||||
|
# foo: foo.o $(GITLIBS)
|
||||||
|
# $(CC) $(filter %.o,$^) $(LIBS)
|
||||||
|
#
|
||||||
|
# where we use it as a dependency. Since we also pull object files
|
||||||
|
# from the dependency list, that would make each entry appear twice.
|
||||||
|
LIBS = $(filter-out %.o, $(GITLIBS)) $(EXTLIBS)
|
||||||
|
|
||||||
BASIC_CFLAGS += -DSHA1_HEADER='$(SHA1_HEADER_SQ)' \
|
BASIC_CFLAGS += -DSHA1_HEADER='$(SHA1_HEADER_SQ)' \
|
||||||
$(COMPAT_CFLAGS)
|
$(COMPAT_CFLAGS)
|
||||||
|
@ -1708,8 +1716,8 @@ git.sp git.s git.o: EXTRA_CPPFLAGS = \
|
||||||
'-DGIT_INFO_PATH="$(infodir_relative_SQ)"'
|
'-DGIT_INFO_PATH="$(infodir_relative_SQ)"'
|
||||||
|
|
||||||
git$X: git.o GIT-LDFLAGS $(BUILTIN_OBJS) $(GITLIBS)
|
git$X: git.o GIT-LDFLAGS $(BUILTIN_OBJS) $(GITLIBS)
|
||||||
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) git.o \
|
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) \
|
||||||
$(BUILTIN_OBJS) $(LIBS)
|
$(filter %.o,$^) $(LIBS)
|
||||||
|
|
||||||
help.sp help.s help.o: common-cmds.h
|
help.sp help.s help.o: common-cmds.h
|
||||||
|
|
||||||
|
@ -1902,6 +1910,7 @@ TEST_OBJS := $(patsubst %$X,%.o,$(TEST_PROGRAMS))
|
||||||
OBJECTS := $(LIB_OBJS) $(BUILTIN_OBJS) $(PROGRAM_OBJS) $(TEST_OBJS) \
|
OBJECTS := $(LIB_OBJS) $(BUILTIN_OBJS) $(PROGRAM_OBJS) $(TEST_OBJS) \
|
||||||
$(XDIFF_OBJS) \
|
$(XDIFF_OBJS) \
|
||||||
$(VCSSVN_OBJS) \
|
$(VCSSVN_OBJS) \
|
||||||
|
common-main.o \
|
||||||
git.o
|
git.o
|
||||||
ifndef NO_CURL
|
ifndef NO_CURL
|
||||||
OBJECTS += http.o http-walker.o remote-curl.o
|
OBJECTS += http.o http-walker.o remote-curl.o
|
||||||
|
|
|
@ -0,0 +1,41 @@
|
||||||
|
#include "cache.h"
|
||||||
|
#include "exec_cmd.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Many parts of Git have subprograms communicate via pipe, expect the
|
||||||
|
* upstream of a pipe to die with SIGPIPE when the downstream of a
|
||||||
|
* pipe does not need to read all that is written. Some third-party
|
||||||
|
* programs that ignore or block SIGPIPE for their own reason forget
|
||||||
|
* to restore SIGPIPE handling to the default before spawning Git and
|
||||||
|
* break this carefully orchestrated machinery.
|
||||||
|
*
|
||||||
|
* Restore the way SIGPIPE is handled to default, which is what we
|
||||||
|
* expect.
|
||||||
|
*/
|
||||||
|
static void restore_sigpipe_to_default(void)
|
||||||
|
{
|
||||||
|
sigset_t unblock;
|
||||||
|
|
||||||
|
sigemptyset(&unblock);
|
||||||
|
sigaddset(&unblock, SIGPIPE);
|
||||||
|
sigprocmask(SIG_UNBLOCK, &unblock, NULL);
|
||||||
|
signal(SIGPIPE, SIG_DFL);
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int argc, const char **argv)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* Always open file descriptors 0/1/2 to avoid clobbering files
|
||||||
|
* in die(). It also avoids messing up when the pipes are dup'ed
|
||||||
|
* onto stdin/stdout/stderr in the child processes we spawn.
|
||||||
|
*/
|
||||||
|
sanitize_stdfds();
|
||||||
|
|
||||||
|
git_setup_gettext();
|
||||||
|
|
||||||
|
argv[0] = git_extract_argv0_path(argv[0]);
|
||||||
|
|
||||||
|
restore_sigpipe_to_default();
|
||||||
|
|
||||||
|
return cmd_main(argc, argv);
|
||||||
|
}
|
|
@ -538,7 +538,7 @@ extern CRITICAL_SECTION pinfo_cs;
|
||||||
void mingw_startup(void);
|
void mingw_startup(void);
|
||||||
#define main(c,v) dummy_decl_mingw_main(void); \
|
#define main(c,v) dummy_decl_mingw_main(void); \
|
||||||
static int mingw_main(c,v); \
|
static int mingw_main(c,v); \
|
||||||
int main(int argc, char **argv) \
|
int main(int argc, const char **argv) \
|
||||||
{ \
|
{ \
|
||||||
mingw_startup(); \
|
mingw_startup(); \
|
||||||
return mingw_main(__argc, (void *)__argv); \
|
return mingw_main(__argc, (void *)__argv); \
|
||||||
|
|
|
@ -257,7 +257,7 @@ static void init_socket_directory(const char *path)
|
||||||
free(path_copy);
|
free(path_copy);
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, const char **argv)
|
int cmd_main(int argc, const char **argv)
|
||||||
{
|
{
|
||||||
const char *socket_path;
|
const char *socket_path;
|
||||||
int ignore_sighup = 0;
|
int ignore_sighup = 0;
|
||||||
|
|
|
@ -83,7 +83,7 @@ static void do_cache(const char *socket, const char *action, int timeout,
|
||||||
strbuf_release(&buf);
|
strbuf_release(&buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, const char **argv)
|
int cmd_main(int argc, const char **argv)
|
||||||
{
|
{
|
||||||
char *socket_path = NULL;
|
char *socket_path = NULL;
|
||||||
int timeout = 900;
|
int timeout = 900;
|
||||||
|
|
|
@ -142,7 +142,7 @@ static void lookup_credential(const struct string_list *fns, struct credential *
|
||||||
return; /* Found credential */
|
return; /* Found credential */
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int cmd_main(int argc, const char **argv)
|
||||||
{
|
{
|
||||||
const char * const usage[] = {
|
const char * const usage[] = {
|
||||||
"git credential-store [<options>] <action>",
|
"git credential-store [<options>] <action>",
|
||||||
|
|
16
daemon.c
16
daemon.c
|
@ -1,6 +1,5 @@
|
||||||
#include "cache.h"
|
#include "cache.h"
|
||||||
#include "pkt-line.h"
|
#include "pkt-line.h"
|
||||||
#include "exec_cmd.h"
|
|
||||||
#include "run-command.h"
|
#include "run-command.h"
|
||||||
#include "strbuf.h"
|
#include "strbuf.h"
|
||||||
#include "string-list.h"
|
#include "string-list.h"
|
||||||
|
@ -32,7 +31,7 @@ static const char daemon_usage[] =
|
||||||
" [<directory>...]";
|
" [<directory>...]";
|
||||||
|
|
||||||
/* List of acceptable pathname prefixes */
|
/* List of acceptable pathname prefixes */
|
||||||
static char **ok_paths;
|
static const char **ok_paths;
|
||||||
static int strict_paths;
|
static int strict_paths;
|
||||||
|
|
||||||
/* If this is set, git-daemon-export-ok is not required */
|
/* If this is set, git-daemon-export-ok is not required */
|
||||||
|
@ -240,7 +239,7 @@ static const char *path_ok(const char *directory, struct hostinfo *hi)
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ok_paths && *ok_paths ) {
|
if ( ok_paths && *ok_paths ) {
|
||||||
char **pp;
|
const char **pp;
|
||||||
int pathlen = strlen(path);
|
int pathlen = strlen(path);
|
||||||
|
|
||||||
/* The validation is done on the paths after enter_repo
|
/* The validation is done on the paths after enter_repo
|
||||||
|
@ -1194,7 +1193,7 @@ static int serve(struct string_list *listen_addr, int listen_port,
|
||||||
return service_loop(&socklist);
|
return service_loop(&socklist);
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int cmd_main(int argc, const char **argv)
|
||||||
{
|
{
|
||||||
int listen_port = 0;
|
int listen_port = 0;
|
||||||
struct string_list listen_addr = STRING_LIST_INIT_NODUP;
|
struct string_list listen_addr = STRING_LIST_INIT_NODUP;
|
||||||
|
@ -1204,12 +1203,8 @@ int main(int argc, char **argv)
|
||||||
struct credentials *cred = NULL;
|
struct credentials *cred = NULL;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
git_setup_gettext();
|
|
||||||
|
|
||||||
git_extract_argv0_path(argv[0]);
|
|
||||||
|
|
||||||
for (i = 1; i < argc; i++) {
|
for (i = 1; i < argc; i++) {
|
||||||
char *arg = argv[i];
|
const char *arg = argv[i];
|
||||||
const char *v;
|
const char *v;
|
||||||
|
|
||||||
if (skip_prefix(arg, "--listen=", &v)) {
|
if (skip_prefix(arg, "--listen=", &v)) {
|
||||||
|
@ -1383,8 +1378,7 @@ int main(int argc, char **argv)
|
||||||
if (detach) {
|
if (detach) {
|
||||||
if (daemonize())
|
if (daemonize())
|
||||||
die("--detach not supported on this platform");
|
die("--detach not supported on this platform");
|
||||||
} else
|
}
|
||||||
sanitize_stdfds();
|
|
||||||
|
|
||||||
if (pid_file)
|
if (pid_file)
|
||||||
write_file(pid_file, "%"PRIuMAX, (uintmax_t) getpid());
|
write_file(pid_file, "%"PRIuMAX, (uintmax_t) getpid());
|
||||||
|
|
|
@ -164,7 +164,6 @@ Format of STDIN stream:
|
||||||
#include "refs.h"
|
#include "refs.h"
|
||||||
#include "csum-file.h"
|
#include "csum-file.h"
|
||||||
#include "quote.h"
|
#include "quote.h"
|
||||||
#include "exec_cmd.h"
|
|
||||||
#include "dir.h"
|
#include "dir.h"
|
||||||
|
|
||||||
#define PACK_ID_BITS 16
|
#define PACK_ID_BITS 16
|
||||||
|
@ -300,7 +299,7 @@ static int failure;
|
||||||
static FILE *pack_edges;
|
static FILE *pack_edges;
|
||||||
static unsigned int show_stats = 1;
|
static unsigned int show_stats = 1;
|
||||||
static int global_argc;
|
static int global_argc;
|
||||||
static char **global_argv;
|
static const char **global_argv;
|
||||||
|
|
||||||
/* Memory pools */
|
/* Memory pools */
|
||||||
static size_t mem_pool_alloc = 2*1024*1024 - sizeof(struct mem_pool);
|
static size_t mem_pool_alloc = 2*1024*1024 - sizeof(struct mem_pool);
|
||||||
|
@ -3384,14 +3383,10 @@ static void parse_argv(void)
|
||||||
read_marks();
|
read_marks();
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int cmd_main(int argc, const char **argv)
|
||||||
{
|
{
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
git_extract_argv0_path(argv[0]);
|
|
||||||
|
|
||||||
git_setup_gettext();
|
|
||||||
|
|
||||||
if (argc == 2 && !strcmp(argv[1], "-h"))
|
if (argc == 2 && !strcmp(argv[1], "-h"))
|
||||||
usage(fast_import_usage);
|
usage(fast_import_usage);
|
||||||
|
|
||||||
|
|
|
@ -1045,3 +1045,5 @@ struct tm *git_gmtime_r(const time_t *, struct tm *);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
extern int cmd_main(int, const char **);
|
||||||
|
|
37
git.c
37
git.c
|
@ -609,48 +609,15 @@ static int run_argv(int *argcp, const char ***argv)
|
||||||
return done_alias;
|
return done_alias;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
int cmd_main(int argc, const char **argv)
|
||||||
* Many parts of Git have subprograms communicate via pipe, expect the
|
|
||||||
* upstream of a pipe to die with SIGPIPE when the downstream of a
|
|
||||||
* pipe does not need to read all that is written. Some third-party
|
|
||||||
* programs that ignore or block SIGPIPE for their own reason forget
|
|
||||||
* to restore SIGPIPE handling to the default before spawning Git and
|
|
||||||
* break this carefully orchestrated machinery.
|
|
||||||
*
|
|
||||||
* Restore the way SIGPIPE is handled to default, which is what we
|
|
||||||
* expect.
|
|
||||||
*/
|
|
||||||
static void restore_sigpipe_to_default(void)
|
|
||||||
{
|
{
|
||||||
sigset_t unblock;
|
|
||||||
|
|
||||||
sigemptyset(&unblock);
|
|
||||||
sigaddset(&unblock, SIGPIPE);
|
|
||||||
sigprocmask(SIG_UNBLOCK, &unblock, NULL);
|
|
||||||
signal(SIGPIPE, SIG_DFL);
|
|
||||||
}
|
|
||||||
|
|
||||||
int main(int argc, char **av)
|
|
||||||
{
|
|
||||||
const char **argv = (const char **) av;
|
|
||||||
const char *cmd;
|
const char *cmd;
|
||||||
int done_help = 0;
|
int done_help = 0;
|
||||||
|
|
||||||
cmd = git_extract_argv0_path(argv[0]);
|
cmd = argv[0];
|
||||||
if (!cmd)
|
if (!cmd)
|
||||||
cmd = "git-help";
|
cmd = "git-help";
|
||||||
|
|
||||||
/*
|
|
||||||
* Always open file descriptors 0/1/2 to avoid clobbering files
|
|
||||||
* in die(). It also avoids messing up when the pipes are dup'ed
|
|
||||||
* onto stdin/stdout/stderr in the child processes we spawn.
|
|
||||||
*/
|
|
||||||
sanitize_stdfds();
|
|
||||||
|
|
||||||
restore_sigpipe_to_default();
|
|
||||||
|
|
||||||
git_setup_gettext();
|
|
||||||
|
|
||||||
trace_command_performance(argv);
|
trace_command_performance(argv);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -632,7 +632,7 @@ static struct service_cmd {
|
||||||
{"POST", "/git-receive-pack$", service_rpc}
|
{"POST", "/git-receive-pack$", service_rpc}
|
||||||
};
|
};
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int cmd_main(int argc, const char **argv)
|
||||||
{
|
{
|
||||||
char *method = getenv("REQUEST_METHOD");
|
char *method = getenv("REQUEST_METHOD");
|
||||||
char *dir;
|
char *dir;
|
||||||
|
@ -640,9 +640,6 @@ int main(int argc, char **argv)
|
||||||
char *cmd_arg = NULL;
|
char *cmd_arg = NULL;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
git_setup_gettext();
|
|
||||||
|
|
||||||
git_extract_argv0_path(argv[0]);
|
|
||||||
set_die_routine(die_webcgi);
|
set_die_routine(die_webcgi);
|
||||||
set_die_is_recursing_routine(die_webcgi_recursing);
|
set_die_is_recursing_routine(die_webcgi_recursing);
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
static const char http_fetch_usage[] = "git http-fetch "
|
static const char http_fetch_usage[] = "git http-fetch "
|
||||||
"[-c] [-t] [-a] [-v] [--recover] [-w ref] [--stdin] commit-id url";
|
"[-c] [-t] [-a] [-v] [--recover] [-w ref] [--stdin] commit-id url";
|
||||||
|
|
||||||
int main(int argc, const char **argv)
|
int cmd_main(int argc, const char **argv)
|
||||||
{
|
{
|
||||||
struct walker *walker;
|
struct walker *walker;
|
||||||
int commits_on_stdin = 0;
|
int commits_on_stdin = 0;
|
||||||
|
@ -22,10 +22,6 @@ int main(int argc, const char **argv)
|
||||||
int get_verbosely = 0;
|
int get_verbosely = 0;
|
||||||
int get_recover = 0;
|
int get_recover = 0;
|
||||||
|
|
||||||
git_setup_gettext();
|
|
||||||
|
|
||||||
git_extract_argv0_path(argv[0]);
|
|
||||||
|
|
||||||
while (arg < argc && argv[arg][0] == '-') {
|
while (arg < argc && argv[arg][0] == '-') {
|
||||||
if (argv[arg][1] == 't') {
|
if (argv[arg][1] == 't') {
|
||||||
get_tree = 1;
|
get_tree = 1;
|
||||||
|
|
10
http-push.c
10
http-push.c
|
@ -1692,12 +1692,12 @@ static void run_request_queue(void)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int cmd_main(int argc, const char **argv)
|
||||||
{
|
{
|
||||||
struct transfer_request *request;
|
struct transfer_request *request;
|
||||||
struct transfer_request *next_request;
|
struct transfer_request *next_request;
|
||||||
int nr_refspec = 0;
|
int nr_refspec = 0;
|
||||||
char **refspec = NULL;
|
const char **refspec = NULL;
|
||||||
struct remote_lock *ref_lock = NULL;
|
struct remote_lock *ref_lock = NULL;
|
||||||
struct remote_lock *info_ref_lock = NULL;
|
struct remote_lock *info_ref_lock = NULL;
|
||||||
struct rev_info revs;
|
struct rev_info revs;
|
||||||
|
@ -1709,15 +1709,11 @@ int main(int argc, char **argv)
|
||||||
int new_refs;
|
int new_refs;
|
||||||
struct ref *ref, *local_refs;
|
struct ref *ref, *local_refs;
|
||||||
|
|
||||||
git_setup_gettext();
|
|
||||||
|
|
||||||
git_extract_argv0_path(argv[0]);
|
|
||||||
|
|
||||||
repo = xcalloc(1, sizeof(*repo));
|
repo = xcalloc(1, sizeof(*repo));
|
||||||
|
|
||||||
argv++;
|
argv++;
|
||||||
for (i = 1; i < argc; i++, argv++) {
|
for (i = 1; i < argc; i++, argv++) {
|
||||||
char *arg = *argv;
|
const char *arg = *argv;
|
||||||
|
|
||||||
if (*arg == '-') {
|
if (*arg == '-') {
|
||||||
if (!strcmp(arg, "--all")) {
|
if (!strcmp(arg, "--all")) {
|
||||||
|
|
|
@ -1494,16 +1494,12 @@ static int curl_append_msgs_to_imap(struct imap_server_conf *server,
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int cmd_main(int argc, const char **argv)
|
||||||
{
|
{
|
||||||
struct strbuf all_msgs = STRBUF_INIT;
|
struct strbuf all_msgs = STRBUF_INIT;
|
||||||
int total;
|
int total;
|
||||||
int nongit_ok;
|
int nongit_ok;
|
||||||
|
|
||||||
git_extract_argv0_path(argv[0]);
|
|
||||||
|
|
||||||
git_setup_gettext();
|
|
||||||
|
|
||||||
setup_git_directory_gently(&nongit_ok);
|
setup_git_directory_gently(&nongit_ok);
|
||||||
git_imap_config();
|
git_imap_config();
|
||||||
|
|
||||||
|
|
|
@ -984,14 +984,11 @@ static void parse_push(struct strbuf *buf)
|
||||||
free(specs);
|
free(specs);
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, const char **argv)
|
int cmd_main(int argc, const char **argv)
|
||||||
{
|
{
|
||||||
struct strbuf buf = STRBUF_INIT;
|
struct strbuf buf = STRBUF_INIT;
|
||||||
int nongit;
|
int nongit;
|
||||||
|
|
||||||
git_setup_gettext();
|
|
||||||
|
|
||||||
git_extract_argv0_path(argv[0]);
|
|
||||||
setup_git_directory_gently(&nongit);
|
setup_git_directory_gently(&nongit);
|
||||||
if (argc < 2) {
|
if (argc < 2) {
|
||||||
error("remote-curl: usage: git remote-curl <remote> [<url>]");
|
error("remote-curl: usage: git remote-curl <remote> [<url>]");
|
||||||
|
|
|
@ -284,7 +284,7 @@ static int do_command(struct strbuf *line)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int cmd_main(int argc, const char **argv)
|
||||||
{
|
{
|
||||||
struct strbuf buf = STRBUF_INIT, url_sb = STRBUF_INIT,
|
struct strbuf buf = STRBUF_INIT, url_sb = STRBUF_INIT,
|
||||||
private_ref_sb = STRBUF_INIT, marksfilename_sb = STRBUF_INIT,
|
private_ref_sb = STRBUF_INIT, marksfilename_sb = STRBUF_INIT,
|
||||||
|
@ -292,7 +292,6 @@ int main(int argc, char **argv)
|
||||||
static struct remote *remote;
|
static struct remote *remote;
|
||||||
const char *url_in;
|
const char *url_in;
|
||||||
|
|
||||||
git_extract_argv0_path(argv[0]);
|
|
||||||
setup_git_directory();
|
setup_git_directory();
|
||||||
if (argc < 2 || argc > 3) {
|
if (argc < 2 || argc > 3) {
|
||||||
usage("git-remote-svn <remote-name> [<url>]");
|
usage("git-remote-svn <remote-name> [<url>]");
|
||||||
|
|
|
@ -64,7 +64,7 @@ static void note_variables (const char *string);
|
||||||
static void subst_from_stdin (void);
|
static void subst_from_stdin (void);
|
||||||
|
|
||||||
int
|
int
|
||||||
main (int argc, char *argv[])
|
cmd_main (int argc, const char *argv[])
|
||||||
{
|
{
|
||||||
/* Default values for command line options. */
|
/* Default values for command line options. */
|
||||||
/* unsigned short int show_variables = 0; */
|
/* unsigned short int show_variables = 0; */
|
||||||
|
|
13
shell.c
13
shell.c
|
@ -138,24 +138,13 @@ static struct commands {
|
||||||
{ NULL },
|
{ NULL },
|
||||||
};
|
};
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int cmd_main(int argc, const char **argv)
|
||||||
{
|
{
|
||||||
char *prog;
|
char *prog;
|
||||||
const char **user_argv;
|
const char **user_argv;
|
||||||
struct commands *cmd;
|
struct commands *cmd;
|
||||||
int count;
|
int count;
|
||||||
|
|
||||||
git_setup_gettext();
|
|
||||||
|
|
||||||
git_extract_argv0_path(argv[0]);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Always open file descriptors 0/1/2 to avoid clobbering files
|
|
||||||
* in die(). It also avoids messing up when the pipes are dup'ed
|
|
||||||
* onto stdin/stdout/stderr in the child processes we spawn.
|
|
||||||
*/
|
|
||||||
sanitize_stdfds();
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Special hack to pretend to be a CVS server
|
* Special hack to pretend to be a CVS server
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -4,15 +4,13 @@
|
||||||
static const char show_index_usage[] =
|
static const char show_index_usage[] =
|
||||||
"git show-index";
|
"git show-index";
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int cmd_main(int argc, const char **argv)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
unsigned nr;
|
unsigned nr;
|
||||||
unsigned int version;
|
unsigned int version;
|
||||||
static unsigned int top_index[256];
|
static unsigned int top_index[256];
|
||||||
|
|
||||||
git_setup_gettext();
|
|
||||||
|
|
||||||
if (argc != 1)
|
if (argc != 1)
|
||||||
usage(show_index_usage);
|
usage(show_index_usage);
|
||||||
if (fread(top_index, 2 * 4, 1, stdin) != 1)
|
if (fread(top_index, 2 * 4, 1, stdin) != 1)
|
||||||
|
|
|
@ -56,7 +56,7 @@ static int timespec_arg(const char *arg, long int *set_time, int *set_eq)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int cmd_main(int argc, const char **argv)
|
||||||
{
|
{
|
||||||
static int verbose;
|
static int verbose;
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int cmd_main(int argc, const char **argv)
|
||||||
{
|
{
|
||||||
int i, val;
|
int i, val;
|
||||||
const char *v;
|
const char *v;
|
||||||
|
|
|
@ -28,7 +28,7 @@ static int is_in(const char *s, int ch)
|
||||||
#define LOWER "abcdefghijklmnopqrstuvwxyz"
|
#define LOWER "abcdefghijklmnopqrstuvwxyz"
|
||||||
#define UPPER "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
#define UPPER "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int cmd_main(int argc, const char **argv)
|
||||||
{
|
{
|
||||||
TEST_CLASS(isdigit, DIGIT);
|
TEST_CLASS(isdigit, DIGIT);
|
||||||
TEST_CLASS(isspace, " \n\r\t");
|
TEST_CLASS(isspace, " \n\r\t");
|
||||||
|
|
|
@ -6,7 +6,7 @@ static const char *usage_msg = "\n"
|
||||||
" test-date parse [date]...\n"
|
" test-date parse [date]...\n"
|
||||||
" test-date approxidate [date]...\n";
|
" test-date approxidate [date]...\n";
|
||||||
|
|
||||||
static void show_relative_dates(char **argv, struct timeval *now)
|
static void show_relative_dates(const char **argv, struct timeval *now)
|
||||||
{
|
{
|
||||||
struct strbuf buf = STRBUF_INIT;
|
struct strbuf buf = STRBUF_INIT;
|
||||||
|
|
||||||
|
@ -18,13 +18,13 @@ static void show_relative_dates(char **argv, struct timeval *now)
|
||||||
strbuf_release(&buf);
|
strbuf_release(&buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void show_dates(char **argv, const char *format)
|
static void show_dates(const char **argv, const char *format)
|
||||||
{
|
{
|
||||||
struct date_mode mode;
|
struct date_mode mode;
|
||||||
|
|
||||||
parse_date_format(format, &mode);
|
parse_date_format(format, &mode);
|
||||||
for (; *argv; argv++) {
|
for (; *argv; argv++) {
|
||||||
char *arg = *argv;
|
char *arg;
|
||||||
time_t t;
|
time_t t;
|
||||||
int tz;
|
int tz;
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ static void show_dates(char **argv, const char *format)
|
||||||
* Do not use our normal timestamp parsing here, as the point
|
* Do not use our normal timestamp parsing here, as the point
|
||||||
* is to test the formatting code in isolation.
|
* is to test the formatting code in isolation.
|
||||||
*/
|
*/
|
||||||
t = strtol(arg, &arg, 10);
|
t = strtol(*argv, &arg, 10);
|
||||||
while (*arg == ' ')
|
while (*arg == ' ')
|
||||||
arg++;
|
arg++;
|
||||||
tz = atoi(arg);
|
tz = atoi(arg);
|
||||||
|
@ -41,7 +41,7 @@ static void show_dates(char **argv, const char *format)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void parse_dates(char **argv, struct timeval *now)
|
static void parse_dates(const char **argv, struct timeval *now)
|
||||||
{
|
{
|
||||||
struct strbuf result = STRBUF_INIT;
|
struct strbuf result = STRBUF_INIT;
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ static void parse_dates(char **argv, struct timeval *now)
|
||||||
strbuf_release(&result);
|
strbuf_release(&result);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void parse_approxidate(char **argv, struct timeval *now)
|
static void parse_approxidate(const char **argv, struct timeval *now)
|
||||||
{
|
{
|
||||||
for (; *argv; argv++) {
|
for (; *argv; argv++) {
|
||||||
time_t t;
|
time_t t;
|
||||||
|
@ -69,7 +69,7 @@ static void parse_approxidate(char **argv, struct timeval *now)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int cmd_main(int argc, const char **argv)
|
||||||
{
|
{
|
||||||
struct timeval now;
|
struct timeval now;
|
||||||
const char *x;
|
const char *x;
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
static const char usage_str[] =
|
static const char usage_str[] =
|
||||||
"test-delta (-d|-p) <from_file> <data_file> <out_file>";
|
"test-delta (-d|-p) <from_file> <data_file> <out_file>";
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int cmd_main(int argc, const char **argv)
|
||||||
{
|
{
|
||||||
int fd;
|
int fd;
|
||||||
struct stat st;
|
struct stat st;
|
||||||
|
|
|
@ -54,7 +54,7 @@ static int dump_cache_tree(struct cache_tree *it,
|
||||||
return errs;
|
return errs;
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int ac, char **av)
|
int cmd_main(int ac, const char **av)
|
||||||
{
|
{
|
||||||
struct index_state istate;
|
struct index_state istate;
|
||||||
struct cache_tree *another = cache_tree();
|
struct cache_tree *another = cache_tree();
|
||||||
|
|
|
@ -7,7 +7,7 @@ static void show_bit(size_t pos, void *data)
|
||||||
printf(" %d", (int)pos);
|
printf(" %d", (int)pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int ac, char **av)
|
int cmd_main(int ac, const char **av)
|
||||||
{
|
{
|
||||||
struct split_index *si;
|
struct split_index *si;
|
||||||
int i;
|
int i;
|
||||||
|
|
|
@ -40,7 +40,7 @@ static void dump(struct untracked_cache_dir *ucd, struct strbuf *base)
|
||||||
strbuf_setlen(base, len);
|
strbuf_setlen(base, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int ac, char **av)
|
int cmd_main(int ac, const char **av)
|
||||||
{
|
{
|
||||||
struct untracked_cache *uc;
|
struct untracked_cache *uc;
|
||||||
struct strbuf base = STRBUF_INIT;
|
struct strbuf base = STRBUF_INIT;
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#include "run-command.h"
|
#include "run-command.h"
|
||||||
#include "strbuf.h"
|
#include "strbuf.h"
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int cmd_main(int argc, const char **argv)
|
||||||
{
|
{
|
||||||
const char *trash_directory = getenv("TRASH_DIRECTORY");
|
const char *trash_directory = getenv("TRASH_DIRECTORY");
|
||||||
struct strbuf buf = STRBUF_INIT;
|
struct strbuf buf = STRBUF_INIT;
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
#include "git-compat-util.h"
|
#include "git-compat-util.h"
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int cmd_main(int argc, const char **argv)
|
||||||
{
|
{
|
||||||
unsigned long count, next = 0;
|
unsigned long count, next = 0;
|
||||||
unsigned char *c;
|
unsigned char *c;
|
||||||
|
|
|
@ -138,7 +138,7 @@ static void perf_hashmap(unsigned int method, unsigned int rounds)
|
||||||
*
|
*
|
||||||
* perfhashmap method rounds -> test hashmap.[ch] performance
|
* perfhashmap method rounds -> test hashmap.[ch] performance
|
||||||
*/
|
*/
|
||||||
int main(int argc, char *argv[])
|
int cmd_main(int argc, const char **argv)
|
||||||
{
|
{
|
||||||
char line[1024];
|
char line[1024];
|
||||||
struct hashmap map;
|
struct hashmap map;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#include "cache.h"
|
#include "cache.h"
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int cmd_main(int argc, const char **argv)
|
||||||
{
|
{
|
||||||
struct cache_header hdr;
|
struct cache_header hdr;
|
||||||
int version;
|
int version;
|
||||||
|
|
|
@ -50,7 +50,7 @@ static void handle_line(const char *line, struct line_buffer *stdin_buf)
|
||||||
handle_command(line, arg + 1, stdin_buf);
|
handle_command(line, arg + 1, stdin_buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int cmd_main(int argc, const char **argv)
|
||||||
{
|
{
|
||||||
struct line_buffer stdin_buf = LINE_BUFFER_INIT;
|
struct line_buffer stdin_buf = LINE_BUFFER_INIT;
|
||||||
struct line_buffer file_buf = LINE_BUFFER_INIT;
|
struct line_buffer file_buf = LINE_BUFFER_INIT;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#include "cache.h"
|
#include "cache.h"
|
||||||
#include "tree.h"
|
#include "tree.h"
|
||||||
|
|
||||||
int main(int ac, char **av)
|
int cmd_main(int ac, const char **av)
|
||||||
{
|
{
|
||||||
struct object_id hash1, hash2, shifted;
|
struct object_id hash1, hash2, shifted;
|
||||||
struct tree *one, *two;
|
struct tree *one, *two;
|
||||||
|
|
|
@ -22,7 +22,7 @@ static int compare_strings(const void *a, const void *b)
|
||||||
return strcmp(x->text, y->text);
|
return strcmp(x->text, y->text);
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int cmd_main(int argc, const char **argv)
|
||||||
{
|
{
|
||||||
struct line *line, *p = NULL, *lines = NULL;
|
struct line *line, *p = NULL, *lines = NULL;
|
||||||
struct strbuf sb = STRBUF_INIT;
|
struct strbuf sb = STRBUF_INIT;
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
*/
|
*/
|
||||||
#include "git-compat-util.h"
|
#include "git-compat-util.h"
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int cmd_main(int argc, const char **argv)
|
||||||
{
|
{
|
||||||
if (argc != 2)
|
if (argc != 2)
|
||||||
usage("Expected 1 parameter defining the temporary file template");
|
usage("Expected 1 parameter defining the temporary file template");
|
||||||
|
|
|
@ -94,7 +94,7 @@ static void show(struct string_list *expect, int *status, const char *fmt, ...)
|
||||||
strbuf_release(&buf);
|
strbuf_release(&buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int cmd_main(int argc, const char **argv)
|
||||||
{
|
{
|
||||||
const char *prefix = "prefix/";
|
const char *prefix = "prefix/";
|
||||||
const char *usage[] = {
|
const char *usage[] = {
|
||||||
|
|
|
@ -156,7 +156,7 @@ static struct test_data dirname_data[] = {
|
||||||
{ NULL, NULL }
|
{ NULL, NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int cmd_main(int argc, const char **argv)
|
||||||
{
|
{
|
||||||
if (argc == 3 && !strcmp(argv[1], "normalize_path_copy")) {
|
if (argc == 3 && !strcmp(argv[1], "normalize_path_copy")) {
|
||||||
char *buf = xmallocz(strlen(argv[2]));
|
char *buf = xmallocz(strlen(argv[2]));
|
||||||
|
@ -213,7 +213,7 @@ int main(int argc, char **argv)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (argc >= 4 && !strcmp(argv[1], "prefix_path")) {
|
if (argc >= 4 && !strcmp(argv[1], "prefix_path")) {
|
||||||
char *prefix = argv[2];
|
const char *prefix = argv[2];
|
||||||
int prefix_len = strlen(prefix);
|
int prefix_len = strlen(prefix);
|
||||||
int nongit_ok;
|
int nongit_ok;
|
||||||
setup_git_directory_gently(&nongit_ok);
|
setup_git_directory_gently(&nongit_ok);
|
||||||
|
|
|
@ -16,7 +16,7 @@ static void show(int *v)
|
||||||
free(v);
|
free(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int cmd_main(int argc, const char **argv)
|
||||||
{
|
{
|
||||||
struct prio_queue pq = { intcmp };
|
struct prio_queue pq = { intcmp };
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#include "cache.h"
|
#include "cache.h"
|
||||||
|
|
||||||
int main (int argc, char **argv)
|
int cmd_main(int argc, const char **argv)
|
||||||
{
|
{
|
||||||
int i, cnt = 1;
|
int i, cnt = 1;
|
||||||
if (argc == 2)
|
if (argc == 2)
|
||||||
|
|
|
@ -36,7 +36,7 @@ static int test_regex_bug(void)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int cmd_main(int argc, const char **argv)
|
||||||
{
|
{
|
||||||
const char *pat;
|
const char *pat;
|
||||||
const char *str;
|
const char *str;
|
||||||
|
|
|
@ -45,7 +45,7 @@ static int run_revision_walk(void)
|
||||||
return got_revision;
|
return got_revision;
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int cmd_main(int argc, const char **argv)
|
||||||
{
|
{
|
||||||
if (argc < 2)
|
if (argc < 2)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
|
@ -49,7 +49,7 @@ static int task_finished(int result,
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int cmd_main(int argc, const char **argv)
|
||||||
{
|
{
|
||||||
struct child_process proc = CHILD_PROCESS_INIT;
|
struct child_process proc = CHILD_PROCESS_INIT;
|
||||||
int jobs;
|
int jobs;
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
static struct lock_file index_lock;
|
static struct lock_file index_lock;
|
||||||
|
|
||||||
int main(int ac, char **av)
|
int cmd_main(int ac, const char **av)
|
||||||
{
|
{
|
||||||
hold_locked_index(&index_lock, 1);
|
hold_locked_index(&index_lock, 1);
|
||||||
if (read_cache() < 0)
|
if (read_cache() < 0)
|
||||||
|
|
|
@ -6,7 +6,7 @@ static void print_sha1(const unsigned char sha1[20], void *data)
|
||||||
puts(sha1_to_hex(sha1));
|
puts(sha1_to_hex(sha1));
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int cmd_main(int argc, const char **argv)
|
||||||
{
|
{
|
||||||
struct sha1_array array = SHA1_ARRAY_INIT;
|
struct sha1_array array = SHA1_ARRAY_INIT;
|
||||||
struct strbuf line = STRBUF_INIT;
|
struct strbuf line = STRBUF_INIT;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#include "cache.h"
|
#include "cache.h"
|
||||||
|
|
||||||
int main(int ac, char **av)
|
int cmd_main(int ac, const char **av)
|
||||||
{
|
{
|
||||||
git_SHA_CTX ctx;
|
git_SHA_CTX ctx;
|
||||||
unsigned char sha1[20];
|
unsigned char sha1[20];
|
||||||
|
|
|
@ -13,7 +13,7 @@ X(two)
|
||||||
X(three)
|
X(three)
|
||||||
#undef X
|
#undef X
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
int cmd_main(int argc, const char **argv) {
|
||||||
sigchain_push(SIGTERM, one);
|
sigchain_push(SIGTERM, one);
|
||||||
sigchain_push(SIGTERM, two);
|
sigchain_push(SIGTERM, two);
|
||||||
sigchain_push(SIGTERM, three);
|
sigchain_push(SIGTERM, three);
|
||||||
|
|
|
@ -41,7 +41,7 @@ static int prefix_cb(struct string_list_item *item, void *cb_data)
|
||||||
return starts_with(item->string, prefix);
|
return starts_with(item->string, prefix);
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int cmd_main(int argc, const char **argv)
|
||||||
{
|
{
|
||||||
if (argc == 5 && !strcmp(argv[1], "split")) {
|
if (argc == 5 && !strcmp(argv[1], "split")) {
|
||||||
struct string_list list = STRING_LIST_INIT_DUP;
|
struct string_list list = STRING_LIST_INIT_DUP;
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#include "submodule-config.h"
|
#include "submodule-config.h"
|
||||||
#include "submodule.h"
|
#include "submodule.h"
|
||||||
|
|
||||||
static void die_usage(int argc, char **argv, const char *msg)
|
static void die_usage(int argc, const char **argv, const char *msg)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "%s\n", msg);
|
fprintf(stderr, "%s\n", msg);
|
||||||
fprintf(stderr, "Usage: %s [<commit> <submodulepath>] ...\n", argv[0]);
|
fprintf(stderr, "Usage: %s [<commit> <submodulepath>] ...\n", argv[0]);
|
||||||
|
@ -14,9 +14,9 @@ static int git_test_config(const char *var, const char *value, void *cb)
|
||||||
return parse_submodule_config_option(var, value);
|
return parse_submodule_config_option(var, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int cmd_main(int argc, const char **argv)
|
||||||
{
|
{
|
||||||
char **arg = argv;
|
const char **arg = argv;
|
||||||
int my_argc = argc;
|
int my_argc = argc;
|
||||||
int output_url = 0;
|
int output_url = 0;
|
||||||
int lookup_name = 0;
|
int lookup_name = 0;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#include "cache.h"
|
#include "cache.h"
|
||||||
#include "run-command.h"
|
#include "run-command.h"
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int cmd_main(int argc, const char **argv)
|
||||||
{
|
{
|
||||||
struct child_process cp = CHILD_PROCESS_INIT;
|
struct child_process cp = CHILD_PROCESS_INIT;
|
||||||
int nogit = 0;
|
int nogit = 0;
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
static const char test_svnfe_usage[] =
|
static const char test_svnfe_usage[] =
|
||||||
"test-svn-fe (<dumpfile> | [-d] <preimage> <delta> <len>)";
|
"test-svn-fe (<dumpfile> | [-d] <preimage> <delta> <len>)";
|
||||||
|
|
||||||
static int apply_delta(int argc, char *argv[])
|
static int apply_delta(int argc, const char **argv)
|
||||||
{
|
{
|
||||||
struct line_buffer preimage = LINE_BUFFER_INIT;
|
struct line_buffer preimage = LINE_BUFFER_INIT;
|
||||||
struct line_buffer delta = LINE_BUFFER_INIT;
|
struct line_buffer delta = LINE_BUFFER_INIT;
|
||||||
|
@ -35,7 +35,7 @@ static int apply_delta(int argc, char *argv[])
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int cmd_main(int argc, const char **argv)
|
||||||
{
|
{
|
||||||
if (argc == 2) {
|
if (argc == 2) {
|
||||||
if (svndump_init(argv[1]))
|
if (svndump_init(argv[1]))
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#include "git-compat-util.h"
|
#include "git-compat-util.h"
|
||||||
#include "urlmatch.h"
|
#include "urlmatch.h"
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int cmd_main(int argc, const char **argv)
|
||||||
{
|
{
|
||||||
const char usage[] = "test-urlmatch-normalization [-p | -l] <url1> | <url1> <url2>";
|
const char usage[] = "test-urlmatch-normalization [-p | -l] <url1> | <url1> <url2>";
|
||||||
char *url1, *url2;
|
char *url1, *url2;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#include "cache.h"
|
#include "cache.h"
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int cmd_main(int argc, const char **argv)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
for (i = 2; i < argc; i++) {
|
for (i = 2; i < argc; i++) {
|
||||||
|
|
|
@ -813,20 +813,17 @@ static int upload_pack_config(const char *var, const char *value, void *unused)
|
||||||
return parse_hide_refs_config(var, value, "uploadpack");
|
return parse_hide_refs_config(var, value, "uploadpack");
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int cmd_main(int argc, const char **argv)
|
||||||
{
|
{
|
||||||
char *dir;
|
const char *dir;
|
||||||
int i;
|
int i;
|
||||||
int strict = 0;
|
int strict = 0;
|
||||||
|
|
||||||
git_setup_gettext();
|
|
||||||
|
|
||||||
packet_trace_identity("upload-pack");
|
packet_trace_identity("upload-pack");
|
||||||
git_extract_argv0_path(argv[0]);
|
|
||||||
check_replace_refs = 0;
|
check_replace_refs = 0;
|
||||||
|
|
||||||
for (i = 1; i < argc; i++) {
|
for (i = 1; i < argc; i++) {
|
||||||
char *arg = argv[i];
|
const char *arg = argv[i];
|
||||||
|
|
||||||
if (arg[0] != '-')
|
if (arg[0] != '-')
|
||||||
break;
|
break;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче