git🐮 Rename temporary worktree directory

Shorten the "worktree" and place the random bytes at the end for better
sorting.
This commit is contained in:
2025-09-15 13:21:20 +02:00
parent d5a95f9ce5
commit d28ef61694

View File

@@ -37,7 +37,7 @@ local git_dir REPO_NAME WORKTREE_PATH
git_dir="${$(git rev-parse --git-dir):A}"
[[ $git_dir == */.git/modules/* ]] || git_dir="${git_dir%%/.git*}"
REPO_NAME="${git_dir:t}"
WORKTREE_PATH="$(mktemp -d -p "" "worktree.XXX.$REPO_NAME.${1//\//_}")"
WORKTREE_PATH="$(mktemp -d -p "" "wtree.$REPO_NAME.${1//\//_}.XXX")"
local errc ret=0
git worktree add "$WORKTREE_PATH" "$@" || ret=$?