mirror of
https://github.com/Llewellynvdm/starship.git
synced 2024-11-28 15:56:28 +00:00
fix(directory): contract git repo with display path (#2304)
This commit is contained in:
parent
19461a0694
commit
d14736dbfe
@ -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.
|
||||||
|
Loading…
Reference in New Issue
Block a user