Re-addressing
Then it walks what the copy now claims about itself and applies one of three dispositions.
Then it walks what the copy now claims about itself and applies one of three dispositions.
| Disposition | What it applies to |
|---|---|
| Repair | core.hooksPath, which is rewritten to the clone's own hooks |
| Drop | worktree registrations, at the top level and inside every submodule's git directory |
| Report | symlinks and virtualenvs, which doctor names and leaves alone |
Dropping the registrations is what keeps a clone from claiming the canonical's
worktrees. Those registrations are copied along with the submodule git
directories that hold them, and a clone that inherits them tells remove it is
hosting worktrees it has never seen.
Copying
`gitto` copies the whole directory with the filesystem's clone call, so the copy shares its blocks with the canonical and costs only the metadata. Nothing is excluded and nothing is rebuilt: `.git`, the submodules, `node_modules`, the build directory and the untracked local files all come along.
Measuring the filesystem
Before any of that, `gitto` writes a 32 MB probe file, clones it with the system call, and compares free space before and after. A copy that consumed the probe's own size was a full copy, whatever the exit status said.