Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'builtin-pack-objects.c')
-rw-r--r--builtin-pack-objects.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c
index acb05554d4..d2bb12e574 100644
--- a/builtin-pack-objects.c
+++ b/builtin-pack-objects.c
@@ -1464,7 +1464,7 @@ static unsigned int check_delta_limit(struct object_entry *me, unsigned int n)
return m;
}
-static unsigned long free_unpacked_data(struct unpacked *n)
+static unsigned long free_unpacked(struct unpacked *n)
{
unsigned long freed_mem = sizeof_delta_index(n->index);
free_delta_index(n->index);
@@ -1474,12 +1474,6 @@ static unsigned long free_unpacked_data(struct unpacked *n)
free(n->data);
n->data = NULL;
}
- return freed_mem;
-}
-
-static unsigned long free_unpacked(struct unpacked *n)
-{
- unsigned long freed_mem = free_unpacked_data(n);
n->entry = NULL;
n->depth = 0;
return freed_mem;
@@ -1520,7 +1514,7 @@ static void find_deltas(struct object_entry **list, unsigned *list_size,
mem_usage > window_memory_limit &&
count > 1) {
uint32_t tail = (idx + window - count) % window;
- mem_usage -= free_unpacked_data(array + tail);
+ mem_usage -= free_unpacked(array + tail);
count--;
}
@@ -1553,9 +1547,6 @@ static void find_deltas(struct object_entry **list, unsigned *list_size,
if (!m->entry)
break;
ret = try_delta(n, m, max_depth, &mem_usage);
- if (window_memory_limit &&
- mem_usage > window_memory_limit)
- mem_usage -= free_unpacked_data(m);
if (ret < 0)
break;
else if (ret > 0)
@@ -2042,7 +2033,8 @@ static void get_object_list(int ac, const char **av)
die("bad revision '%s'", line);
}
- prepare_revision_walk(&revs);
+ if (prepare_revision_walk(&revs))
+ die("revision walk setup failed");
mark_edges_uninteresting(revs.commits, &revs, show_edge);
traverse_commit_list(&revs, show_commit, show_object);