From: Richard Hartmann Date: Thu, 23 Oct 2014 18:45:06 +0000 (+0200) Subject: vcsh: Factor out code from status() into status_helper() X-Git-Url: https://git.madduck.net/code/vcsh.git/commitdiff_plain/c03340ae79c2230828c3b3e15a314e167f637d2e?hp=--cc vcsh: Factor out code from status() into status_helper() --- c03340ae79c2230828c3b3e15a314e167f637d2e diff --git a/vcsh b/vcsh index 9480b48..54026cf 100755 --- a/vcsh +++ b/vcsh @@ -361,22 +361,23 @@ run() { status() { if [ -n "$VCSH_REPO_NAME" ]; then - GIT_DIR=$VCSH_REPO_D/$VCSH_REPO_NAME.git; export GIT_DIR - use - git status --short --untracked-files='no' - VCSH_COMMAND_RETURN_CODE=$? + status_helper $VCSH_REPO_NAME else for VCSH_REPO_NAME in $(list); do echo "$VCSH_REPO_NAME:" - GIT_DIR=$VCSH_REPO_D/$VCSH_REPO_NAME.git; export GIT_DIR - use - git status --short --untracked-files='no' - VCSH_COMMAND_RETURN_CODE=$? + status_helper $VCSH_REPO_NAME echo done fi } +status_helper() { + GIT_DIR=$VCSH_REPO_D/$VCSH_REPO_NAME.git; export GIT_DIR + use + git status --short --untracked-files='no' + VCSH_COMMAND_RETURN_CODE=$? +} + upgrade() { hook pre-upgrade # fake-bare repositories are not bare, actually. Set this to false