git-svnimport: support for incremental import
[gitweb.git] / git.c
diff --git a/git.c b/git.c
index 5822296e6e6ef79e6c334d7f3f2426ce8f81ff96..c82ca458e47186cd926dc83030cb7a6c8a697e8d 100644 (file)
--- a/git.c
+++ b/git.c
@@ -59,16 +59,18 @@ static int handle_options(const char*** argv, int* argc)
                } else if (!strcmp(cmd, "-p") || !strcmp(cmd, "--paginate")) {
                        setup_pager();
                } else if (!strcmp(cmd, "--git-dir")) {
-                       if (*argc < 1)
-                               return -1;
-                       setenv("GIT_DIR", (*argv)[1], 1);
+                       if (*argc < 2) {
+                               fprintf(stderr, "No directory given for --git-dir.\n" );
+                               usage(git_usage_string);
+                       }
+                       setenv(GIT_DIR_ENVIRONMENT, (*argv)[1], 1);
                        (*argv)++;
                        (*argc)--;
                } else if (!strncmp(cmd, "--git-dir=", 10)) {
-                       setenv("GIT_DIR", cmd + 10, 1);
+                       setenv(GIT_DIR_ENVIRONMENT, cmd + 10, 1);
                } else if (!strcmp(cmd, "--bare")) {
-                       static char git_dir[1024];
-                       setenv("GIT_DIR", getcwd(git_dir, 1024), 1);
+                       static char git_dir[PATH_MAX+1];
+                       setenv(GIT_DIR_ENVIRONMENT, getcwd(git_dir, sizeof(git_dir)), 1);
                } else {
                        fprintf(stderr, "Unknown option: %s\n", cmd);
                        usage(git_usage_string);
@@ -246,6 +248,7 @@ static void handle_internal_command(int argc, const char **argv, char **envp)
                { "read-tree", cmd_read_tree, RUN_SETUP },
                { "reflog", cmd_reflog, RUN_SETUP },
                { "repo-config", cmd_repo_config },
+               { "rerere", cmd_rerere, RUN_SETUP },
                { "rev-list", cmd_rev_list, RUN_SETUP },
                { "rev-parse", cmd_rev_parse, RUN_SETUP },
                { "rm", cmd_rm, RUN_SETUP },