1
0
mirror of https://github.com/Llewellynvdm/starship.git synced 2024-11-24 21:57:41 +00:00

fix(directory): contract git repo with display path (#2304)

This commit is contained in:
David Knaack 2021-02-14 18:15:47 +01:00 committed by GitHub
parent 19461a0694
commit d14736dbfe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -58,10 +58,7 @@ pub fn module<'a>(context: &'a Context) -> Option<Module<'a>> {
let dir_string = repo let dir_string = repo
.and_then(|r| r.root.as_ref()) .and_then(|r| r.root.as_ref())
.filter(|root| *root != &home_dir) .filter(|root| *root != &home_dir)
// NOTE: Always attempt to contract repo paths from the physical dir as .and_then(|root| contract_repo_path(&display_dir, root));
// the logical dir _may_ not be be a valid physical disk
// path and may be impossible to contract.
.and_then(|root| contract_repo_path(&physical_dir, root));
// Otherwise use the logical path, automatically contracting // Otherwise use the logical path, automatically contracting
// the home directory if required. // the home directory if required.