diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2016-11-07 05:27:33 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2016-11-07 05:27:33 +0300 |
commit | b29384dd9dc3d6aabba772e1dac86f584ef11da9 (patch) | |
tree | 31615f0e71285d2d656d6b569546e6e12849c939 /%HOME% | |
parent | bugfix & code style (diff) | |
download | linux-home-b29384dd9dc3d6aabba772e1dac86f584ef11da9.tar.gz linux-home-b29384dd9dc3d6aabba772e1dac86f584ef11da9.zip |
list_repo_*: replace with simple aliases
Diffstat (limited to '%HOME%')
-rw-r--r-- | %HOME%/.bash_utils/git.sh | 57 |
1 files 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 |