From db16c3435cfa50b77d325c3290b1f25af5a9a239 Mon Sep 17 00:00:00 2001 From: Maurice Date: Fri, 19 Mar 2021 17:49:36 +0100 Subject: [PATCH] Add option to set custom path to git binary (#3393) * Add option to set custom path to git binary * words * style * Move `binary` config down above `commands` config. Co-authored-by: Jason Varga Co-authored-by: Jesse Leite --- config/git.php | 12 ++++++++++++ src/Console/Processes/Git.php | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/config/git.php b/config/git.php index ff401dc7ea..c2ad89eb38 100644 --- a/config/git.php +++ b/config/git.php @@ -86,6 +86,18 @@ storage_path('forms'), ], + /* + |-------------------------------------------------------------------------- + | Git Binary + |-------------------------------------------------------------------------- + | + | By default, Statamic will try to use the "git" command, but you can set + | an absolute path to the git binary if necessary for your environment. + | + */ + + 'binary' => env('STATAMIC_GIT_BINARY', 'git'), + /* |-------------------------------------------------------------------------- | Commands diff --git a/src/Console/Processes/Git.php b/src/Console/Processes/Git.php index 406bdc83a0..a35d0dd7f7 100644 --- a/src/Console/Processes/Git.php +++ b/src/Console/Processes/Git.php @@ -54,7 +54,7 @@ private function runGitCommand(...$parts) */ private function prepareProcessArguments($parts) { - return collect(['git']) + return collect([config('statamic.git.binary')]) ->merge($parts) ->flatten() ->reject(function ($part) {