1
0
mirror of https://github.com/Llewellynvdm/starship.git synced 2024-11-28 07:46:28 +00:00

fix(fossil_branch): fossil checkout database file name on windows (#4978)

fix(fossil_branch): use proper fossil checkout database file name on windows
This commit is contained in:
Stefan Cosma 2023-03-14 18:56:29 +01:00 committed by GitHub
parent 9d7a039930
commit c07a21d48a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 2 deletions

View File

@ -17,9 +17,15 @@ pub fn module<'a>(context: &'a Context) -> Option<Module<'a>> {
return None;
};
let checkout_db = if cfg!(windows) {
"_FOSSIL_"
} else {
".fslckout"
};
let is_checkout = context
.try_begin_scan()?
.set_files(&[".fslckout"])
.set_files(&[checkout_db])
.is_match();
if !is_checkout {

View File

@ -176,11 +176,16 @@ pub enum FixtureProvider {
pub fn fixture_repo(provider: FixtureProvider) -> io::Result<TempDir> {
match provider {
FixtureProvider::Fossil => {
let checkout_db = if cfg!(windows) {
"_FOSSIL_"
} else {
".fslckout"
};
let path = tempfile::tempdir()?;
fs::OpenOptions::new()
.create(true)
.write(true)
.open(path.path().join(".fslckout"))?
.open(path.path().join(checkout_db))?
.sync_all()?;
Ok(path)
}