don't check ignored files when checking for uncommitted changes

This commit is contained in:
Cyborus 2024-05-11 11:29:39 -04:00
parent 85ee804919
commit b2eec654b8
No known key found for this signature in database

View file

@ -684,7 +684,9 @@ async fn checkout_pr(
let local_repo = git2::Repository::open(".").unwrap();
let has_no_uncommited = local_repo.statuses(None).unwrap().is_empty();
let mut options = git2::StatusOptions::new();
options.include_ignored(false);
let has_no_uncommited = local_repo.statuses(Some(&mut options)).unwrap().is_empty();
eyre::ensure!(
has_no_uncommited,
"Cannot checkout PR, working directory has uncommited changes"