Parsed representation of a git worktree entry.
Contains the path, HEAD commit SHA, branch reference, and flags indicating whether the worktree is bare or has a detached HEAD.
Summary
Functions
Parses the porcelain output of git worktree list --porcelain into a list
of Git.Worktree structs.
Types
Functions
Parses the porcelain output of git worktree list --porcelain into a list
of Git.Worktree structs.
The porcelain format separates entries with blank lines. Each entry has key-value lines like:
worktree /path/to/main
HEAD abc1234
branch refs/heads/mainExamples
iex> Git.Worktree.parse("worktree /tmp/main\nHEAD abc1234\nbranch refs/heads/main\n\n")
[%Git.Worktree{path: "/tmp/main", head: "abc1234", branch: "refs/heads/main", bare: false, detached: false}]
iex> Git.Worktree.parse("")
[]