mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
editor: do not rely on the_repository for interactive edits
We implicitly rely on `the_repository` when editing a file interactively because we call `git_path()`. Adapt the function to instead take a `struct repository` as a parameter so that we can remove this hidden dependency. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
61419a42f6
commit
419dbb29d8
@@ -1140,7 +1140,8 @@ static int edit_hunk_manually(struct add_p_state *s, struct hunk *hunk)
|
||||
"removed, then the edit is\n"
|
||||
"aborted and the hunk is left unchanged.\n"));
|
||||
|
||||
if (strbuf_edit_interactively(&s->buf, "addp-hunk-edit.diff", NULL) < 0)
|
||||
if (strbuf_edit_interactively(the_repository, &s->buf,
|
||||
"addp-hunk-edit.diff", NULL) < 0)
|
||||
return -1;
|
||||
|
||||
/* strip out commented lines */
|
||||
|
||||
Reference in New Issue
Block a user