Skip to content

Worktree 0.17.1

Choose a tag to compare

@github-actions github-actions released this 12 Oct 21:19
· 29 commits to main since this release
  • discard-cache (and finish --discard-cache, sweep) never deletes a nested Git repository,
    whatever kind of recognised directory holds it. 0.17.0 deleted a Cargo target, or its tmp/,
    whatever it held, including a fixture repository a test wrote into CARGO_TARGET_TMPDIR with
    commits no remote holds; finish --discard-cache --archive discards before it archives, so it
    lost those commits before the archive could image them.
  • The walk 0.17.0 used only for a Flutter app's output now decides for every cache kind: a
    recognised directory holding a .git (a file, a directory or a symbolic link) at any depth
    below it, found by a walk that follows no symbolic link (an entry or directory it cannot read
    counts as one), is never deleted whole. A whole Cargo target holding one is no longer
    cargo-target and falls to its parts, each profile, nested target and tmp/ under its own
    rule. A tmp/ holding one deletes each direct entry holding none (a file or symbolic link
    included) as cargo-target-tmp, reported per entry as <target>/tmp/<entry>, and retains each
    entry holding one. A profile, node_modules, virtual environment, tool cache or Flutter output
    directory holding one is retained whole.
  • The walk also recognises a Git directory that has no .git entry, whatever its name: a bare
    repository (such as a test's remote.git in tmp/) or one placed with --separate-git-dir,
    by HEAD as a regular file and objects/ and refs/ as real directories, none reached
    through a symbolic link. Such a directory, or one holding one at any depth, is handled exactly
    as one holding a .git, including as a direct entry of tmp/.
  • The walk is repeated immediately before each deletion for every kind, not only Flutter output;
    a directory that is or holds a repository then is retained whole.
  • Retained repositories appear in retained_ignored; finish --discard-cache --archive images
    each one, and the tree is still collected through that archive. No cache kind, JSON field or
    protocol version changes.
  • Keeping is not recovering. A tree whose kept state the archive cannot image stays, and the
    refusal names the path: a fixture repository with a linked worktree makes
    finish --discard-cache --archive refuse archive-unsupported-entry naming its
    .git/worktrees/<name>, and a directory in tmp/ no walk can read makes gc refuse
    worktree-state-unreadable naming it. Nothing in either is deleted.
  • A repository is never build layout in an archive, cargo's or a Flutter app's. 0.17.0 left a
    bare repository inside a profile (target/release/build/<crate>/out/remote.git) out of a
    worktree.archive/3 as cargo build layout, with no image and no blocker; discard-cache kept
    the profile, but gc --apply then removed the tree, and the repository's only copy of its
    commits with it. archive and finish --archive now keep every path with a .git component,
    or at or below a Git directory observed on disk (the same rule discard-cache uses: HEAD a
    regular file, objects/ and refs/ real directories, none reached through a symbolic link), in
    dirty.patch as an ordinary untracked file and in the fingerprint. One I/O-free rule in the
    domain (repository_path, layout_directory) decides it for archive, verification, removal
    and the strip from the observations each supplies (GitDirectoryFacts on disk).
  • Verification computes the fingerprint by the same rule, so such an archive verifies against
    its tree, and removal through a format 3 archive re-observes it immediately before deleting a
    left-out file: a path that is now at or below a Git directory, or has a .git component, is
    never deleted as build layout; it must match the archive as any other file does, or refuses.
  • prune-archives --strip-build-output never strips a section whose path has a .git
    component, or lies at or below a directory D for which the patch purely adds D/HEAD and at
    least one path under D/objects/ (a Git directory, as the patch can show one). No manifest
    field, format or protocol version changes.