]> git.ipfire.org Git - thirdparty/git.git/blobdiff - bundle.c
git-svn: disable _rev_list memoization
[thirdparty/git.git] / bundle.c
index b2b89fe8628eb29b613754ee8e837fd56de185da..fa67057e60fe638825cc80e65cb1fa0be5b26ed9 100644 (file)
--- a/bundle.c
+++ b/bundle.c
@@ -1,4 +1,5 @@
 #include "cache.h"
+#include "lockfile.h"
 #include "bundle.h"
 #include "object.h"
 #include "commit.h"
@@ -209,26 +210,29 @@ static int is_tag_in_date_range(struct object *tag, struct rev_info *revs)
 {
        unsigned long size;
        enum object_type type;
-       char *buf, *line, *lineend;
+       char *buf = NULL, *line, *lineend;
        unsigned long date;
+       int result = 1;
 
        if (revs->max_age == -1 && revs->min_age == -1)
-               return 1;
+               goto out;
 
        buf = read_sha1_file(tag->sha1, &type, &size);
        if (!buf)
-               return 1;
+               goto out;
        line = memmem(buf, size, "\ntagger ", 8);
        if (!line++)
-               return 1;
+               goto out;
        lineend = memchr(line, '\n', buf + size - line);
        line = memchr(line, '>', lineend ? lineend - line : buf + size - line);
        if (!line++)
-               return 1;
+               goto out;
        date = strtoul(line, NULL, 10);
-       free(buf);
-       return (revs->max_age == -1 || revs->max_age < date) &&
+       result = (revs->max_age == -1 || revs->max_age < date) &&
                (revs->min_age == -1 || revs->min_age > date);
+out:
+       free(buf);
+       return result;
 }
 
 int create_bundle(struct bundle_header *header, const char *path,
@@ -306,7 +310,7 @@ int create_bundle(struct bundle_header *header, const char *path,
                        continue;
                if (dwim_ref(e->name, strlen(e->name), sha1, &ref) != 1)
                        continue;
-               if (read_ref_full(e->name, sha1, 1, &flag))
+               if (read_ref_full(e->name, RESOLVE_REF_READING, sha1, &flag))
                        flag = 0;
                display_ref = (flag & REF_ISSYMREF) ? e->name : ref;