Skip to main content

is_staged

Function is_staged 

Source
pub fn is_staged(repo_root: &Path, file: &Path) -> bool
Expand description

Check if a file is staged (has changes in the index)

§Arguments

  • repo_root - The root directory of the git repository
  • file - The absolute path to the file to check

§Returns

  • true if the file has staged changes
  • false if the file is not staged or not in a git repo