Skip to content

Commit 20f4b04

Browse files
peffgitster
authored andcommitted
sequencer: drop repository argument from run_git_commit()
When we switched to using an external git-commit call in b0a3186 (sequencer: simplify root commit creation, 2019-08-19), this function didn't need to care about the repository object any more. Arguably we could be passing along the repository path to the external git-commit by using "--git-dir=r->path" here. But for the most part the sequencer code relies on sub-process finding the same repository we're already in (using the same environment variables or discovery process we did). But we don't have a convenient interface for doing so, and there's no indication that we need to. Let's just drop the unused parameter for now. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 5b9427e commit 20f4b04

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

sequencer.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -934,8 +934,7 @@ static int run_command_silent_on_success(struct child_process *cmd)
934934
* interactive rebase: in that case, we will want to retain the
935935
* author metadata.
936936
*/
937-
static int run_git_commit(struct repository *r,
938-
const char *defmsg,
937+
static int run_git_commit(const char *defmsg,
939938
struct replay_opts *opts,
940939
unsigned int flags)
941940
{
@@ -1545,7 +1544,7 @@ static int do_commit(struct repository *r,
15451544
if (is_rebase_i(opts) && oid)
15461545
if (write_rebase_head(oid))
15471546
return -1;
1548-
return run_git_commit(r, msg_file, opts, flags);
1547+
return run_git_commit(msg_file, opts, flags);
15491548
}
15501549

15511550
return res;
@@ -2060,7 +2059,7 @@ static int do_pick_commit(struct repository *r,
20602059
*check_todo = !!(flags & EDIT_MSG);
20612060
if (!res && reword) {
20622061
fast_forward_edit:
2063-
res = run_git_commit(r, NULL, opts, EDIT_MSG |
2062+
res = run_git_commit(NULL, opts, EDIT_MSG |
20642063
VERIFY_MSG | AMEND_MSG |
20652064
(flags & ALLOW_EMPTY));
20662065
*check_todo = 1;
@@ -3748,7 +3747,7 @@ static int do_merge(struct repository *r,
37483747
* command needs to be rescheduled).
37493748
*/
37503749
fast_forward_edit:
3751-
ret = !!run_git_commit(r, git_path_merge_msg(r), opts,
3750+
ret = !!run_git_commit(git_path_merge_msg(r), opts,
37523751
run_commit_flags);
37533752

37543753
leave_merge:
@@ -4437,7 +4436,7 @@ static int commit_staged_changes(struct repository *r,
44374436
return 0;
44384437
}
44394438

4440-
if (run_git_commit(r, final_fixup ? NULL : rebase_path_message(),
4439+
if (run_git_commit(final_fixup ? NULL : rebase_path_message(),
44414440
opts, flags))
44424441
return error(_("could not commit staged changes."));
44434442
unlink(rebase_path_amend());

0 commit comments

Comments
 (0)