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>
This commit is contained in:
garrytanandcapy-ai[bot] committed 2026-10-26 19:47:12 +00:00
1 parent f343c537ee
commit 00387ffa10
1 file changed
+4 -1
+4 -1
View File
@@ -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"