[odrbin] git-wtclone: use env vars instead of -C

This commit is contained in:
odrling 2023-11-26 00:30:05 +01:00
parent f4c1de11ff
commit d722c79bc6
No known key found for this signature in database
GPG key ID: E24CA7508C27AF5B

View file

@ -17,8 +17,10 @@ fi
GIT_WORK_TREE="$(realpath "$worktree")"
if ! git clone --separate-git-dir "$GIT_DIR" "$url" "$GIT_WORK_TREE"; then
export GIT_DIR
export GIT_WORK_TREE
mkdir -p "$GIT_WORK_TREE"
echo "gitdir: $GIT_DIR" > "$GIT_WORK_TREE/.git"
git -C "GIT_WORK_TREE" fetch
git -C "$GIT_WORK_TREE" checkout "$GIT_WORK_TREE"
git fetch
git checkout "$GIT_WORK_TREE"
fi