Skip to content

Commit 9f67899

Browse files
phillipwoodgitster
authored andcommitted
sequencer: use rebase_path_message()
Rather than constructing the path in a struct strbuf use the ready made function to get the path name instead. This was the last remaining use of the strbuf so remove it as well. As with the previous patch we now use a hard coded string rather than git_dir() when constructing the path. This is safe for the same reason (make_patch() is only called when rebasing) and is protected by the assertion added in the previous patch. Signed-off-by: Phillip Wood <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 206a78d commit 9f67899

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

sequencer.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3484,7 +3484,6 @@ static int make_patch(struct repository *r,
34843484
struct commit *commit,
34853485
struct replay_opts *opts)
34863486
{
3487-
struct strbuf buf = STRBUF_INIT;
34883487
struct rev_info log_tree_opt;
34893488
const char *subject;
34903489
char hex[GIT_MAX_HEXSZ + 1];
@@ -3515,18 +3514,16 @@ static int make_patch(struct repository *r,
35153514
fclose(log_tree_opt.diffopt.file);
35163515
}
35173516

3518-
strbuf_addf(&buf, "%s/message", get_dir(opts));
3519-
if (!file_exists(buf.buf)) {
3517+
if (!file_exists(rebase_path_message())) {
35203518
const char *encoding = get_commit_output_encoding();
35213519
const char *commit_buffer = repo_logmsg_reencode(r,
35223520
commit, NULL,
35233521
encoding);
35243522
find_commit_subject(commit_buffer, &subject);
3525-
res |= write_message(subject, strlen(subject), buf.buf, 1);
3523+
res |= write_message(subject, strlen(subject), rebase_path_message(), 1);
35263524
repo_unuse_commit_buffer(r, commit,
35273525
commit_buffer);
35283526
}
3529-
strbuf_release(&buf);
35303527
release_revisions(&log_tree_opt);
35313528

35323529
return res;

0 commit comments

Comments
 (0)