mirror of
https://codeberg.org/Cyborus/forgejo-cli.git
synced 2024-11-10 12:09:33 +01:00
Merge pull request 'don't check ignored files when checking for uncommitted changes' (#59) from ignore-ignored into main
This commit is contained in:
commit
a259a44eca
1 changed files with 3 additions and 1 deletions
|
@ -684,7 +684,9 @@ async fn checkout_pr(
|
||||||
|
|
||||||
let local_repo = git2::Repository::open(".").unwrap();
|
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!(
|
eyre::ensure!(
|
||||||
has_no_uncommited,
|
has_no_uncommited,
|
||||||
"Cannot checkout PR, working directory has uncommited changes"
|
"Cannot checkout PR, working directory has uncommited changes"
|
||||||
|
|
Loading…
Reference in a new issue