archive: move file extension format-guessing lower
[gitweb.git] / archive-tar.c
index 1ab1a2caf53b01b5704cb9f61e9584d2ca3e553d..bed9a9b15ce07fbb1ff0f40902e1b317b82663e9 100644 (file)
@@ -234,12 +234,11 @@ static int git_tar_config(const char *var, const char *value, void *cb)
        return 0;
 }
 
-int write_tar_archive(struct archiver_args *args)
+static int write_tar_archive(const struct archiver *ar,
+                            struct archiver_args *args)
 {
        int err = 0;
 
-       git_config(git_tar_config, NULL);
-
        if (args->commit_sha1)
                err = write_global_extended_header(args);
        if (!err)
@@ -248,3 +247,15 @@ int write_tar_archive(struct archiver_args *args)
                write_trailer();
        return err;
 }
+
+static struct archiver tar_archiver = {
+       "tar",
+       write_tar_archive,
+       0
+};
+
+void init_tar_archiver(void)
+{
+       register_archiver(&tar_archiver);
+       git_config(git_tar_config, NULL);
+}