From 00387ffa10caae9ef1bda0337a57631d58a0879b Mon Sep 17 00:00:00 2001 From: garrytan Date: Mon, 26 Oct 2026 19:47:12 +0000 Subject: [PATCH] ubicloud: pack skips a split index (its shared half stays in the original git dir) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> --- scripts/ubicloud/ubi-runner.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/ubicloud/ubi-runner.sh b/scripts/ubicloud/ubi-runner.sh index abb1f6c06..77925713d 100755 --- a/scripts/ubicloud/ubi-runner.sh +++ b/scripts/ubicloud/ubi-runner.sh @@ -602,7 +602,10 @@ cmd_pack() { gitdir=$(cd "$src" && cd "$(git rev-parse --git-common-dir)" && pwd) git clone -q --bare --no-local --single-branch --branch "$branch" "$gitdir" "$tmp/.git" git -C "$tmp/.git" config core.bare false - cp "$(cd "$src" && cd "$(dirname "$(git rev-parse --git-path index)")" && pwd)/index" "$tmp/.git/index" + # The worktree's index rides along so the VM's status matches, except a + # split index, whose shared half lives only in the original git dir. + [ "$(git -C "$src" config --bool core.splitIndex 2>/dev/null)" = true ] \ + || cp "$(cd "$src" && cd "$(dirname "$(git rev-parse --git-path index)")" && pwd)/index" "$tmp/.git/index" fi ( cd "$src"