aboutsummaryrefslogtreecommitdiff
path: root/editor.h
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-08-13 11:13:25 +0200
committerJunio C Hamano <gitster@pobox.com>2024-08-13 10:01:00 -0700
commit419dbb29d82b78bcaf0ff22ac7d5db7d1c327575 (patch)
tree43c8322954e0ad8da0e2e60fd3e692ede6c89b92 /editor.h
parent61419a42f641c7b9f7bfc9585e3ec9c393ab0166 (diff)
downloadgit-419dbb29d82b78bcaf0ff22ac7d5db7d1c327575.tar.xz
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>
Diffstat (limited to 'editor.h')
-rw-r--r--editor.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/editor.h b/editor.h
index 8016bb5e00..f1c41df378 100644
--- a/editor.h
+++ b/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