A project folder whose .git pointed into another repo on the host (a
gitdir file, a commondir, alternates) passed the --clone check, and the
seed push copied that other repo's branches into the VM.
gitprotect.OwnRepo now checks what git reads in the folder: a .git
folder without a commondir, or a linked worktree's .git file whose link
git made both ways (its gitdir is <repo>/.git/worktrees/<name>, that
entry's gitdir file names this .git back, and its commondir leads to
that <repo>/.git); no alternates, and no objects, packed-refs, reftable
or refs that are symlinks, in the git dir or the common dir. cloneSource
runs it before the VM is made and again before the push, and checks
that git's rev-parse --absolute-git-dir and --git-common-dir agree. A
worktree's push sends only its branch and that branch's upstream.
gitprotect's commondir and gitdir resolution are shared (commonOf,
resolvedDir) rather than copied. New messages: clone_git_elsewhere,
clone_alternates. Tests: TestCheckCloneRepoPointers (failed on the
previous code), TestSeedRefs, TestUpCloneWorktree, TestOwnRepo, and
clone.txtar's refusals.
Co-Authored-By: Claude Opus 5.5 <[email protected]>