-
-
Notifications
You must be signed in to change notification settings - Fork 313
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1371 from Byron/fix-empty-excludes-file
empty paths don't error in lenient mode
- Loading branch information
Showing
6 changed files
with
45 additions
and
1 deletion.
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
Binary file modified
BIN
+244 Bytes
(100%)
gix/tests/fixtures/generated-archives/make_basic_repo.tar.xz
Binary file not shown.
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
use crate::util::named_subrepo_opts; | ||
use gix_worktree::stack::state::ignore::Source; | ||
|
||
#[test] | ||
fn empty_core_excludes() -> crate::Result { | ||
let repo = named_subrepo_opts( | ||
"make_basic_repo.sh", | ||
"empty-core-excludes", | ||
gix::open::Options::default().strict_config(true), | ||
)?; | ||
let index = repo.index_or_empty()?; | ||
match repo.excludes(&index, None, Source::WorktreeThenIdMappingIfNotSkipped) { | ||
Ok(_) => { | ||
unreachable!("Should fail due to empty excludes path") | ||
} | ||
Err(err) => { | ||
assert_eq!( | ||
err.to_string(), | ||
"The value for `core.excludesFile` could not be read from configuration" | ||
); | ||
} | ||
}; | ||
|
||
let repo = gix::open_opts(repo.git_dir(), repo.open_options().clone().strict_config(false))?; | ||
repo.excludes(&index, None, Source::WorktreeThenIdMappingIfNotSkipped) | ||
.expect("empty paths are now just skipped"); | ||
Ok(()) | ||
} |
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