From de15b15ff0ce572fd9ab4f45c6a4aeda3b958b93 Mon Sep 17 00:00:00 2001 From: Eric Nielsen Date: Mon, 10 Apr 2017 20:58:12 -0500 Subject: [PATCH] Remove git dependency on is-true function The function is currently only being used for checking the result of `git rev-parse --is-inside-work-tree`. Checking for the return code of the command is enough. --- modules/git/functions/git-commit-lost | 2 +- modules/git/functions/git-stash-clear-interactive | 2 +- modules/git/functions/git-stash-dropped | 2 +- modules/git/functions/git-stash-recover | 2 +- modules/git/functions/git-submodule-move | 2 +- modules/git/functions/git-submodule-remove | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/git/functions/git-commit-lost b/modules/git/functions/git-commit-lost index 671e1e7..b327ec7 100644 --- a/modules/git/functions/git-commit-lost +++ b/modules/git/functions/git-commit-lost @@ -1,4 +1,4 @@ -if ! is-true "$(command git rev-parse --is-inside-work-tree 2> /dev/null)"; then +if ! command git rev-parse --is-inside-work-tree >/dev/null 2>&1; then print "${0}: not a repository work tree: ${PWD}" >&2 return 1 fi diff --git a/modules/git/functions/git-stash-clear-interactive b/modules/git/functions/git-stash-clear-interactive index 0197be9..1342364 100644 --- a/modules/git/functions/git-stash-clear-interactive +++ b/modules/git/functions/git-stash-clear-interactive @@ -1,4 +1,4 @@ -if ! is-true "$(command git rev-parse --is-inside-work-tree 2> /dev/null)"; then +if ! command git rev-parse --is-inside-work-tree >/dev/null 2>&1; then print "${0}: not a repository work tree: ${PWD}" >&2 return 1 fi diff --git a/modules/git/functions/git-stash-dropped b/modules/git/functions/git-stash-dropped index 1cc979b..2190d05 100644 --- a/modules/git/functions/git-stash-dropped +++ b/modules/git/functions/git-stash-dropped @@ -1,4 +1,4 @@ -if ! is-true "$(command git rev-parse --is-inside-work-tree 2> /dev/null)"; then +if ! command git rev-parse --is-inside-work-tree >/dev/null 2>&1; then print "${0}: not a repository work tree: ${PWD}" >&2 return 1 fi diff --git a/modules/git/functions/git-stash-recover b/modules/git/functions/git-stash-recover index 8b5adec..cdfbc2f 100644 --- a/modules/git/functions/git-stash-recover +++ b/modules/git/functions/git-stash-recover @@ -1,4 +1,4 @@ -if ! is-true "$(command git rev-parse --is-inside-work-tree 2> /dev/null)"; then +if ! command git rev-parse --is-inside-work-tree >/dev/null 2>&1; then print "${0}: not a repository work tree: ${PWD}" >&2 return 1 fi diff --git a/modules/git/functions/git-submodule-move b/modules/git/functions/git-submodule-move index 2f7132c..0596785 100644 --- a/modules/git/functions/git-submodule-move +++ b/modules/git/functions/git-submodule-move @@ -1,4 +1,4 @@ -if ! is-true "$(command git rev-parse --is-inside-work-tree 2> /dev/null)"; then +if ! command git rev-parse --is-inside-work-tree >/dev/null 2>&1; then print "${0}: not a repository work tree: ${PWD}" >&2 return 1 elif [[ "${PWD}" != "$(git-root)" ]]; then diff --git a/modules/git/functions/git-submodule-remove b/modules/git/functions/git-submodule-remove index 033d39a..aa4c852 100644 --- a/modules/git/functions/git-submodule-remove +++ b/modules/git/functions/git-submodule-remove @@ -1,4 +1,4 @@ -if ! is-true "$(command git rev-parse --is-inside-work-tree 2> /dev/null)"; then +if ! command git rev-parse --is-inside-work-tree >/dev/null 2>&1; then print "${0}: not a repository work tree: ${PWD}" >&2 return 1 elif [[ "${PWD}" != "$(git-root)" ]]; then