OSDN Git Service

Git 2.11.2
[git-core/git.git] / archive.c
index dde1ab4..01751e5 100644 (file)
--- a/archive.c
+++ b/archive.c
@@ -504,15 +504,11 @@ static int parse_archive_args(int argc, const char **argv,
 }
 
 int write_archive(int argc, const char **argv, const char *prefix,
-                 int setup_prefix, const char *name_hint, int remote)
+                 const char *name_hint, int remote)
 {
-       int nongit = 0;
        const struct archiver *ar = NULL;
        struct archiver_args args;
 
-       if (setup_prefix && prefix == NULL)
-               prefix = setup_git_directory_gently(&nongit);
-
        git_config_get_bool("uploadarchive.allowunreachable", &remote_allow_unreachable);
        git_config(git_default_config, NULL);
 
@@ -520,7 +516,7 @@ int write_archive(int argc, const char **argv, const char *prefix,
        init_zip_archiver();
 
        argc = parse_archive_args(argc, argv, &ar, &args, name_hint, remote);
-       if (nongit) {
+       if (!startup_info->have_repository) {
                /*
                 * We know this will die() with an error, so we could just
                 * die ourselves; but its error message will be more specific