mirror of
https://github.com/ohmybash/oh-my-bash.git
synced 2024-05-11 05:55:37 +00:00
global: Use "command" to run "git" and "svn"
This commit is contained in:
@@ -82,7 +82,7 @@ function git_current_branch() {
|
||||
# Gets the number of commits ahead from remote
|
||||
function git_commits_ahead() {
|
||||
if command git rev-parse --git-dir &>/dev/null; then
|
||||
local commits="$(git rev-list --count @{upstream}..HEAD)"
|
||||
local commits="$(command git rev-list --count @{upstream}..HEAD)"
|
||||
if [[ "$commits" != 0 ]]; then
|
||||
echo "$OSH_THEME_GIT_COMMITS_AHEAD_PREFIX$commits$OSH_THEME_GIT_COMMITS_AHEAD_SUFFIX"
|
||||
fi
|
||||
@@ -92,7 +92,7 @@ function git_commits_ahead() {
|
||||
# Gets the number of commits behind remote
|
||||
function git_commits_behind() {
|
||||
if command git rev-parse --git-dir &>/dev/null; then
|
||||
local commits="$(git rev-list --count HEAD..@{upstream})"
|
||||
local commits="$(command git rev-list --count HEAD..@{upstream})"
|
||||
if [[ "$commits" != 0 ]]; then
|
||||
echo "$OSH_THEME_GIT_COMMITS_BEHIND_PREFIX$commits$OSH_THEME_GIT_COMMITS_BEHIND_SUFFIX"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user