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
5
editor.h
5
editor.h
@ -1,6 +1,7 @@
|
||||
#ifndef EDITOR_H
|
||||
#define EDITOR_H
|
||||
|
||||
struct repository;
|
||||
struct strbuf;
|
||||
|
||||
const char *git_editor(void);
|
||||
@ -28,7 +29,7 @@ int launch_sequence_editor(const char *path, struct strbuf *buffer,
|
||||
*
|
||||
* If `path` is relative, it refers to a file in the `.git` directory.
|
||||
*/
|
||||
int strbuf_edit_interactively(struct strbuf *buffer, const char *path,
|
||||
const char *const *env);
|
||||
int strbuf_edit_interactively(struct repository *r, struct strbuf *buffer,
|
||||
const char *path, const char *const *env);
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user