X-Git-Url: https://git.madduck.net/etc/zsh.git/blobdiff_plain/4749d4ded89ab2a937b2e525c0e0df751c760d27..ad7c4bae9781483a15c2a11c9db247edf7c3c365:/.zsh/func/vcsh?ds=inline diff --git a/.zsh/func/vcsh b/.zsh/func/vcsh index e404efc..0a08b5e 100755 --- a/.zsh/func/vcsh +++ b/.zsh/func/vcsh @@ -10,7 +10,7 @@ # Source repository: http://git.madduck.net/v/etc/zsh.git # -FGIT_BASE="$HOME/.fgits" +local FGIT_BASE="$HOME/.fgits" if [ "${1:---help}" = '--help' ] || [ $# -gt 1 ]; then echo "usage: ${0%/*} reponame" >&2 @@ -31,7 +31,11 @@ if [ ! -d "$FGIT_BASE/${1}.git" ]; then return 2 fi -export GIT_DIR=$FGIT_BASE/${1}.git +export GIT_DIR="$FGIT_BASE/${1}.git" +local _WORKTREE="$(git config --get core.worktree)" +export GIT_WORK_TREE="$(readlink -f $GIT_DIR/$_WORKTREE)" +unset _WORKTREE + git status PS1="%S{VCSH:$1}%s$PS1" $SHELL -i