mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-12-16 12:51:50 +03:00
Merge pull request #4174 from gitbutlerapp/cool-with-submodules
cool with submodules
This commit is contained in:
commit
e707bdd812
@ -1,5 +1,5 @@
|
||||
use anyhow::{anyhow, bail, Context};
|
||||
use git2::FileMode;
|
||||
use git2::{DiffOptions, FileMode};
|
||||
use std::collections::HashMap;
|
||||
use std::path::Path;
|
||||
use std::str::{from_utf8, FromStr};
|
||||
@ -301,7 +301,11 @@ impl Project {
|
||||
.or_insert_with(|| tree_from_applied_vbranches(&repo, parent.id()).unwrap());
|
||||
let parent_tree = repo.find_tree(parent_wd_tree_id.to_owned())?;
|
||||
|
||||
let diff = repo.diff_tree_to_tree(Some(&parent_tree), Some(&wd_tree), None)?;
|
||||
let mut opts = DiffOptions::new();
|
||||
opts.include_untracked(true);
|
||||
opts.ignore_submodules(true);
|
||||
let diff =
|
||||
repo.diff_tree_to_tree(Some(&parent_tree), Some(&wd_tree), Some(&mut opts))?;
|
||||
|
||||
let mut files_changed = Vec::new();
|
||||
diff.print(git2::DiffFormat::NameOnly, |delta, _, _| {
|
||||
|
@ -72,9 +72,6 @@ impl Controller {
|
||||
bail!("can only work in main worktrees");
|
||||
};
|
||||
}
|
||||
Ok(repo) if repo.submodules().map_or(false, |sm| sm.is_some()) => {
|
||||
bail!("repositories with git submodules are not supported");
|
||||
}
|
||||
Ok(_repo) => {}
|
||||
Err(err) => {
|
||||
return Err(anyhow::Error::from(err))
|
||||
|
Loading…
Reference in New Issue
Block a user