summaryrefslogtreecommitdiff
path: root/shallow.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-07-30 20:20:30 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-07-30 20:20:30 (GMT)
commitde6dda0dc3d95cd9aaf43a7b85ceeb57316dcc27 (patch)
tree8c970a139cd81136e71e6db49807b55878b6d54e /shallow.c
parent47ae905ffb98cc4d4fd90083da6bc8dab55d9ecc (diff)
parent7fbfe07ab4d4e58c0971dac73001b89f180a0af3 (diff)
downloadgit-de6dda0dc3d95cd9aaf43a7b85ceeb57316dcc27.zip
git-de6dda0dc3d95cd9aaf43a7b85ceeb57316dcc27.tar.gz
git-de6dda0dc3d95cd9aaf43a7b85ceeb57316dcc27.tar.bz2
Merge branch 'sg/commit-graph-cleanups' into master
The changed-path Bloom filter is improved using ideas from an independent implementation. * sg/commit-graph-cleanups: commit-graph: simplify write_commit_graph_file() #2 commit-graph: simplify write_commit_graph_file() #1 commit-graph: simplify parse_commit_graph() #2 commit-graph: simplify parse_commit_graph() #1 commit-graph: clean up #includes diff.h: drop diff_tree_oid() & friends' return value commit-slab: add a function to deep free entries on the slab commit-graph-format.txt: all multi-byte numbers are in network byte order commit-graph: fix parsing the Chunk Lookup table tree-walk.c: don't match submodule entries for 'submod/anything'
Diffstat (limited to 'shallow.c')
-rw-r--r--shallow.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/shallow.c b/shallow.c
index b826de9..91b9e10 100644
--- a/shallow.c
+++ b/shallow.c
@@ -110,6 +110,10 @@ void rollback_shallow_file(struct repository *r, struct shallow_lock *lk)
* supports a "valid" flag.
*/
define_commit_slab(commit_depth, int *);
+static void free_depth_in_slab(int **ptr)
+{
+ FREE_AND_NULL(*ptr);
+}
struct commit_list *get_shallow_commits(struct object_array *heads, int depth,
int shallow_flag, int not_shallow_flag)
{
@@ -176,15 +180,7 @@ struct commit_list *get_shallow_commits(struct object_array *heads, int depth,
}
}
}
- for (i = 0; i < depths.slab_count; i++) {
- int j;
-
- if (!depths.slab[i])
- continue;
- for (j = 0; j < depths.slab_size; j++)
- free(depths.slab[i][j]);
- }
- clear_commit_depth(&depths);
+ deep_clear_commit_depth(&depths, free_depth_in_slab);
return result;
}