Skip to main content

validate_worktree_gitdir

Function validate_worktree_gitdir 

Source
pub async fn validate_worktree_gitdir(worktree_dir: &Path) -> bool
Expand description

Validate that a worktree directory has a working gitdir link.

In a git worktree, .git is a file containing gitdir: /path/to/.git/worktrees/<name>. Returns false when the .git file is missing or points to a non-existent gitdir, indicating the worktree metadata is broken and the directory should be cleaned up.