pashage

Yet Another Opinionated Re-engineering of the Unix Password Store
git clone https://git.instinctive.eu/pashage.git
Log | Files | Refs | README | LICENSE

commit 8cc504d4edef9f2c91ff68ab3d5c078f341b3a87
parent 808245bc6bd9298d9dde2987e6bb7e94230504d0
Author: Natasha Kerensikova <natgh@instinctive.eu>
Date:   Sun, 27 Oct 2024 10:27:53 +0000

Git command without argument calls git utility, like pass
Diffstat:
Mspec/usage_spec.sh | 7+++----
Msrc/pashage.sh | 9+++------
2 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/spec/usage_spec.sh b/spec/usage_spec.sh @@ -801,12 +801,11 @@ Describe 'Command-Line Parsing' The error should equal "$ git -C ${PREFIX} log --oneline" End - It 'reports a lack of argument' - cat() { @cat; } + It 'transmits a lack of argument to git' + PREFIX="${SHELLSPEC_WORKDIR}/repo" When run cmd_git The output should be blank - The error should equal 'Usage: prg git git-command-args ...' - The status should equal 1 + The error should equal "$ git -C ${PREFIX}" End It 'aborts without a git repository' diff --git a/src/pashage.sh b/src/pashage.sh @@ -1218,19 +1218,16 @@ cmd_generate() { } cmd_git() { - if [ $# -lt 1 ]; then - cmd_usage 'Usage: ' git >&2 - exit 1 - elif [ -d "${PREFIX}/.git" ]; then + if [ -d "${PREFIX}/.git" ]; then platform_tmpdir TMPDIR="${SECURE_TMPDIR}" git -C "${PREFIX}" "$@" - elif [ "$1" = init ]; then + elif [ "${1-}" = init ]; then mkdir -p -- "${PREFIX}" git -C "${PREFIX}" "$@" scm_add '.' scm_commit "Add current contents of password store." cmd_gitconfig - elif [ "$1" = clone ]; then + elif [ "${1-}" = clone ]; then git "$@" "${PREFIX}" cmd_gitconfig else