Fix directory truncation in git repositories with symlinks in path #385
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
When setting SPACESHIP_DIR_TRUNC to true, only the root of the repository was show if the path to the directory contained symlinks.
Adding the -P option to the pwd call (avoid all symlinks) fixes this.
In the example below, 'Projects' is the symlink.
Screenshot
Before:
![Before](https://camo.githubusercontent.com/142e945f6d3384a2d2d65e3927ad8865c591cdf7ab56c7fc416045b9a9d0fdcc/68747470733a2f2f64726976652e676f6f676c652e636f6d2f75633f69643d3155544b7165625661734a396c58366856324f75784f364d4364686144686f5675)
After:
![After](https://camo.githubusercontent.com/113629e9e6434aeb3895fae3bee432825377f39a289e93c63930019e684e54c1/68747470733a2f2f64726976652e676f6f676c652e636f6d2f75633f69643d31784a515368774174637138314a4e666159613855766c2d415756625951534964)