diff options
author | Jiang Xin <worldhello.net@gmail.com> | 2019-08-10 20:11:17 +0800 |
---|---|---|
committer | Jiang Xin <worldhello.net@gmail.com> | 2019-08-10 20:11:17 +0800 |
commit | d6d5cbfe87e2eb025ba316afe74b74d009cfd330 (patch) | |
tree | 45035c13b4ea6696000788dcf10c54b588f0bc9b /commit-graph.c | |
parent | 5532a55b340f0f1ce5f7519f3fd359e3f84326ad (diff) | |
parent | 2e27de94d485a6da0c8e264c165e55100f1a13a8 (diff) |
Merge tag 'v2.23.0-rc2' of git://git.kernel.org/pub/scm/git/git
Git 2.23-rc2
* tag 'v2.23.0-rc2' of git://git.kernel.org/pub/scm/git/git: (63 commits)
Git 2.23-rc2
t0000: reword comments for "local" test
t: decrease nesting in test_oid_to_path
sha1-file: release strbuf after use
test-dir-iterator: use path argument directly
dir-iterator: release strbuf after use
commit-graph: release strbufs after use
l10n: reformat some localized strings for v2.23.0
merge-recursive: avoid directory rename detection in recursive case
commit-graph: fix bug around octopus merges
restore: fix typo in docs
doc: typo: s/can not/cannot/ and s/is does/does/
Git 2.23-rc1
log: really flip the --mailmap default
RelNotes/2.23.0: fix a few typos and other minor issues
RelNotes/2.21.1: typofix
log: flip the --mailmap default unconditionally
config: work around bug with includeif:onbranch and early config
A few more last-minute fixes
repack: simplify handling of auto-bitmaps and .keep files
...
Diffstat (limited to 'commit-graph.c')
-rw-r--r-- | commit-graph.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/commit-graph.c b/commit-graph.c index b3c4de79b6..fe954ab5f8 100644 --- a/commit-graph.c +++ b/commit-graph.c @@ -434,6 +434,7 @@ static struct commit_graph *load_commit_graph_chain(struct repository *r, const free(oids); fclose(fp); + strbuf_release(&line); return graph_chain; } @@ -1186,7 +1187,7 @@ static int fill_oids_from_packs(struct write_commit_graph_context *ctx, } stop_progress(&ctx->progress); - strbuf_reset(&progress_title); + strbuf_release(&progress_title); strbuf_release(&packname); return 0; @@ -1636,7 +1637,7 @@ static void sort_and_scan_merged_commits(struct write_commit_graph_context *ctx) num_parents++; if (num_parents > 2) - ctx->num_extra_edges += num_parents - 2; + ctx->num_extra_edges += num_parents - 1; } } @@ -1713,10 +1714,8 @@ static void expire_commit_graphs(struct write_commit_graph_context *ctx) strbuf_addstr(&path, "/info/commit-graphs"); dir = opendir(path.buf); - if (!dir) { - strbuf_release(&path); - return; - } + if (!dir) + goto out; strbuf_addch(&path, '/'); dirnamelen = path.len; @@ -1745,6 +1744,9 @@ static void expire_commit_graphs(struct write_commit_graph_context *ctx) if (!found) unlink(path.buf); } + +out: + strbuf_release(&path); } int write_commit_graph(const char *obj_dir, |