aboutsummaryrefslogtreecommitdiffstats
path: root/sequencer.c
diff options
context:
space:
mode:
Diffstat (limited to 'sequencer.c')
-rw-r--r--sequencer.c26
1 files changed, 19 insertions, 7 deletions
diff --git a/sequencer.c b/sequencer.c
index 8c3ed3532a..bb4046aab3 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -1346,6 +1346,7 @@ void print_commit_summary(struct repository *r,
log_tree_commit(&rev, commit);
}
+ release_revisions(&rev);
strbuf_release(&format);
}
@@ -3414,6 +3415,7 @@ static int make_patch(struct repository *r,
unuse_commit_buffer(commit, commit_buffer);
}
strbuf_release(&buf);
+ release_revisions(&log_tree_opt);
return res;
}
@@ -4524,6 +4526,7 @@ cleanup_head_ref:
&log_tree_opt.diffopt);
log_tree_diff_flush(&log_tree_opt);
}
+ release_revisions(&log_tree_opt);
}
flush_rewritten_pending();
if (!stat(rebase_path_rewritten_list(), &st) &&
@@ -5350,6 +5353,7 @@ int sequencer_make_script(struct repository *r, struct strbuf *out, int argc,
int rebase_merges = flags & TODO_LIST_REBASE_MERGES;
int reapply_cherry_picks = flags & TODO_LIST_REAPPLY_CHERRY_PICKS;
int skipped_commit = 0;
+ int ret = 0;
repo_init_revisions(r, &revs, NULL);
revs.verbose_header = 1;
@@ -5373,14 +5377,20 @@ int sequencer_make_script(struct repository *r, struct strbuf *out, int argc,
pp.fmt = revs.commit_format;
pp.output_encoding = get_log_output_encoding();
- if (setup_revisions(argc, argv, &revs, NULL) > 1)
- return error(_("make_script: unhandled options"));
+ if (setup_revisions(argc, argv, &revs, NULL) > 1) {
+ ret = error(_("make_script: unhandled options"));
+ goto cleanup;
+ }
- if (prepare_revision_walk(&revs) < 0)
- return error(_("make_script: error preparing revisions"));
+ if (prepare_revision_walk(&revs) < 0) {
+ ret = error(_("make_script: error preparing revisions"));
+ goto cleanup;
+ }
- if (rebase_merges)
- return make_script_with_merges(&pp, &revs, out, flags);
+ if (rebase_merges) {
+ ret = make_script_with_merges(&pp, &revs, out, flags);
+ goto cleanup;
+ }
while ((commit = get_revision(&revs))) {
int is_empty = is_original_commit_empty(commit);
@@ -5404,7 +5414,9 @@ int sequencer_make_script(struct repository *r, struct strbuf *out, int argc,
if (skipped_commit)
advise_if_enabled(ADVICE_SKIPPED_CHERRY_PICKS,
_("use --reapply-cherry-picks to include skipped commits"));
- return 0;
+cleanup:
+ release_revisions(&revs);
+ return ret;
}
/*