]> git.ipfire.org Git - thirdparty/git.git/commitdiff
run-command: declare the `git_shell_path()` function globally
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Sat, 13 Jul 2024 21:08:23 +0000 (21:08 +0000)
committerJunio C Hamano <gitster@pobox.com>
Sat, 13 Jul 2024 23:23:37 +0000 (16:23 -0700)
The intention is to use it in `git var GIT_SHELL_PATH`, therefore we
need this function to stop being file-local only.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
run-command.c
run-command.h

index 60a79db8f0ea8e4cca3191ed135015ef1c854fc9..45ba54493230648ba9095b0d2e3776d43ce9b6df 100644 (file)
@@ -274,7 +274,7 @@ int sane_execvp(const char *file, char * const argv[])
        return -1;
 }
 
-static char *git_shell_path(void)
+char *git_shell_path(void)
 {
 #ifndef GIT_WINDOWS_NATIVE
        return xstrdup(SHELL_PATH);
index 55f6631a2aa3425f897aab901897e0d225b02fa5..03e7222d8b5d74dfc962763d2f6fed2641f24d91 100644 (file)
@@ -195,6 +195,11 @@ int is_executable(const char *name);
  */
 int exists_in_PATH(const char *command);
 
+/**
+ * Return the path that is used to execute Unix shell command-lines.
+ */
+char *git_shell_path(void);
+
 /**
  * Start a sub-process. Takes a pointer to a `struct child_process`
  * that specifies the details and returns pipe FDs (if requested).