Skip to main content

is_git_dirty

Function is_git_dirty 

Source
pub fn is_git_dirty(project_dir: &Path) -> bool
Expand description

Check if the git working directory has uncommitted changes.

Runs git status --porcelain and returns true if there is any output, indicating uncommitted changes (modified, staged, or untracked files).

Returns false if:

  • The directory is not a git repository
  • Git is not available on the system
  • The working directory is clean

ยงArguments

  • project_dir - Directory to check (should contain .git)