From b29384dd9dc3d6aabba772e1dac86f584ef11da9 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Mon, 7 Nov 2016 05:27:33 +0300 Subject: list_repo_*: replace with simple aliases --- %HOME%/.bash_utils/git.sh | 57 ++--------------------------------------------- 1 file changed, 2 insertions(+), 55 deletions(-) diff --git a/%HOME%/.bash_utils/git.sh b/%HOME%/.bash_utils/git.sh index 5d74f39..775e224 100644 --- a/%HOME%/.bash_utils/git.sh +++ b/%HOME%/.bash_utils/git.sh @@ -7,61 +7,8 @@ source "$HOME/.bash_utils/text.sh" -list_repo_files() ( - set -o errexit -o nounset -o pipefail - - local -a cmd=(git ls-tree -r) - - while [ "$#" -gt 0 ]; do - local key="$1" - shift - case "$key" in - -h|--help) - echo "usage: ${FUNCNAME[0]} [-h|--help] [-0|-z]" - return 0 - ;; - -0|-z) - cmd+=(-z) - ;; - *) - echo "${FUNCNAME[0]}: unrecognized parameter: $key" >&2 - return 1 - ;; - esac - done - - cmd+=(--name-only HEAD) - - eval ${cmd[@]+"${cmd[@]}"} -) - -list_repo_dirs() ( - set -o errexit -o nounset -o pipefail - - local -a cmd=(git ls-tree -r -d) - - while [ "$#" -gt 0 ]; do - local key="$1" - shift - case "$key" in - -h|--help) - echo "usage: ${FUNCNAME[0]} [-h|--help] [-z|-0]" - return 0 - ;; - -z|-0) - cmd+=(-z) - ;; - *) - echo "${FUNCNAME[0]}: unrecognized parameter: $key" >&2 - return 1 - ;; - esac - done - - cmd+=(--name-only HEAD) - - eval ${cmd[@]+"${cmd[@]}"} -) +alias list_repo_files='git ls-tree -r --name-only HEAD' +alias list_repo_dirs='git ls-tree -r --name-only HEAD -d' tighten_repo_security() ( set -o errexit -o nounset -o pipefail -- cgit v1.2.3