Skip to content
Snippets Groups Projects
Commit 663af6ef authored by Richard Hartmann's avatar Richard Hartmann
Browse files

Re-arrange functions

parent ccb77060
No related branches found
No related tags found
No related merge requests found
...@@ -44,18 +44,6 @@ verbose() { ...@@ -44,18 +44,6 @@ verbose() {
if [ -n "$VCSH_DEBUG" ] || [ -n "$VCSH_VERBOSE" ]; then echo "$SELF: verbose: $@"; fi 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() { init() {
verbose "init() begin" verbose "init() begin"
[ -e "$GIT_DIR" ] && [ -e "$GIT_DIR" ] &&
...@@ -81,6 +69,18 @@ leave() { ...@@ -81,6 +69,18 @@ leave() {
unset VCSH_DIRECTORY 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 if [ "$1" = 'clone' ]; then
export VCSH_COMMAND="$1" export VCSH_COMMAND="$1"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment