Merge pull request 'don't check ignored files when checking for uncommitted changes' (#59) from ignore-ignored into main

This commit is contained in:
Cyborus 2024-05-14 15:50:37 +00:00
commit a259a44eca

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"