]> git.madduck.net Git - code/vcsh.git/commitdiff

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

vcsh: Factor out code from status() into status_helper()
authorRichard Hartmann <richih@debian.org>
Thu, 23 Oct 2014 18:45:06 +0000 (20:45 +0200)
committerRichard Hartmann <richih@debian.org>
Thu, 23 Oct 2014 18:45:06 +0000 (20:45 +0200)
vcsh

diff --git a/vcsh b/vcsh
index 9480b485fe883e390dd9c18da25dda23525fc5b2..54026cf0ac4f67383ec86e5ff831d70b3f0a5222 100755 (executable)
--- 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