From 663af6efe8d81d4386127b8fbd05320f44988658 Mon Sep 17 00:00:00 2001 From: Richard Hartmann Date: Wed, 23 Nov 2011 18:02:44 +0100 Subject: [PATCH] Re-arrange functions --- vcsh | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/vcsh b/vcsh index c8618f1..cb9f216 100755 --- a/vcsh +++ b/vcsh @@ -44,18 +44,6 @@ verbose() { if [ -n "$VCSH_DEBUG" ] || [ -n "$VCSH_VERBOSE" ]; then echo "$SELF: verbose: $@"; fi } -use() { - verbose "use() begin" - if [ ! -d "$GIT_DIR" ]; then - echo E: no repository found for "$VCSH_REPO_NAME" >&2 - return 1 - fi - export GIT_DIR - export GIT_WORK_TREE="$(git config --get core.worktree)" - export VCSH_DIRECTORY="$VCSH_REPO_NAME" - verbose "use() end" -} - init() { verbose "init() begin" [ -e "$GIT_DIR" ] && @@ -81,6 +69,18 @@ leave() { unset VCSH_DIRECTORY } +use() { + verbose "use() begin" + if [ ! -d "$GIT_DIR" ]; then + echo E: no repository found for "$VCSH_REPO_NAME" >&2 + return 1 + fi + export GIT_DIR + export GIT_WORK_TREE="$(git config --get core.worktree)" + export VCSH_DIRECTORY="$VCSH_REPO_NAME" + verbose "use() end" +} + if [ "$1" = 'clone' ]; then export VCSH_COMMAND="$1" -- 2.39.2