match_push_refs(): nobody sets src->peer_ref anymore
[gitweb.git] / archive.c
index 2584324f52fc059b29d4d233734a230efc4a3f49..93e00bb4ae8ff9637be9e55fd41536b8837c3ba2 100644 (file)
--- a/archive.c
+++ b/archive.c
@@ -120,6 +120,8 @@ static int write_archive_entry(const unsigned char *sha1, const char *base,
        strbuf_add(&path, args->base, args->baselen);
        strbuf_add(&path, base, baselen);
        strbuf_addstr(&path, filename);
+       if (S_ISDIR(mode) || S_ISGITLINK(mode))
+               strbuf_addch(&path, '/');
        path_without_prefix = path.buf + args->baselen;
 
        setup_archive_check(check);
@@ -130,7 +132,6 @@ static int write_archive_entry(const unsigned char *sha1, const char *base,
        }
 
        if (S_ISDIR(mode) || S_ISGITLINK(mode)) {
-               strbuf_addch(&path, '/');
                if (args->verbose)
                        fprintf(stderr, "%.*s\n", (int)path.len, path.buf);
                err = write_entry(args, sha1, path.buf, path.len, mode);
@@ -343,7 +344,7 @@ static int parse_archive_args(int argc, const char **argv,
                OPT_GROUP(""),
                OPT_STRING(0, "remote", &remote, N_("repo"),
                        N_("retrieve the archive from remote repository <repo>")),
-               OPT_STRING(0, "exec", &exec, N_("cmd"),
+               OPT_STRING(0, "exec", &exec, N_("command"),
                        N_("path to the remote git-upload-archive command")),
                OPT_END()
        };