]> git.ipfire.org Git - thirdparty/git.git/blobdiff - pack-revindex.c
setup: adopt shared init-db & clone code
[thirdparty/git.git] / pack-revindex.c
index 62a9846470c792aa6bdbfcbfd0d3beefa1e7d40b..1f51b712e879e401e9b308d993a2b810460f01e3 100644 (file)
@@ -1,8 +1,10 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "gettext.h"
 #include "pack-revindex.h"
+#include "object-file.h"
 #include "object-store.h"
 #include "packfile.h"
+#include "trace2.h"
 #include "config.h"
 #include "midx.h"
 #include "csum-file.h"
@@ -212,7 +214,8 @@ static int load_revindex_from_disk(char *revindex_name,
        fd = git_open(revindex_name);
 
        if (fd < 0) {
-               ret = -1;
+               /* "No file" means return 1. */
+               ret = 1;
                goto cleanup;
        }
        if (fstat(fd, &st)) {
@@ -264,7 +267,7 @@ cleanup:
        return ret;
 }
 
-static int load_pack_revindex_from_disk(struct packed_git *p)
+int load_pack_revindex_from_disk(struct packed_git *p)
 {
        char *revindex_name;
        int ret;