We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 9043d12 + 407b855 commit 3d197c4Copy full SHA for 3d197c4
src/helpers.php
@@ -51,11 +51,11 @@ function git_dir()
51
// Don't show command error if git is not initialized
52
$errorToDevNull = is_windows() ? '' : ' 2>/dev/null';
53
54
- $gitDir = trim(shell_exec('git rev-parse --git-common-dir'.$errorToDevNull));
+ $gitDir = trim((string) shell_exec('git rev-parse --git-common-dir'.$errorToDevNull));
55
if ($gitDir === '' || $gitDir === '--git-common-dir') {
56
// the version of git does not support `--git-common-dir`
57
// we fallback to `--git-dir` which and lose worktree support
58
- $gitDir = trim(shell_exec('git rev-parse --git-dir'.$errorToDevNull));
+ $gitDir = trim((string) shell_exec('git rev-parse --git-dir'.$errorToDevNull));
59
}
60
61
return $gitDir === '' ? false : realpath($gitDir);
0 commit comments