-
Notifications
You must be signed in to change notification settings - Fork 562
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace merge-tree in
upstream_integration_statuses
- Loading branch information
Showing
2 changed files
with
66 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,21 @@ impl TestingRepository { | |
pub fn open() -> Self { | ||
let tempdir = tempdir().unwrap(); | ||
let repository = git2::Repository::init_opts(tempdir.path(), &init_opts()).unwrap(); | ||
// TODO(ST): remove this once `gix::Repository::index_or_load_from_tree_or_empty()` | ||
// is available and used to get merge/diff resource caches. | ||
// For now we need a resemblance of an initialized repo. | ||
let signature = git2::Signature::now("Caleb", "[email protected]").unwrap(); | ||
let empty_tree_id = repository.treebuilder(None).unwrap().write().unwrap(); | ||
repository | ||
.commit( | ||
Some("refs/heads/master"), | ||
&signature, | ||
&signature, | ||
"init to prevent load index failure", | ||
&repository.find_tree(empty_tree_id).unwrap(), | ||
&[], | ||
) | ||
.unwrap(); | ||
|
||
let config = repository.config().unwrap(); | ||
match config.open_level(git2::ConfigLevel::Local) { | ||
|