shlib.sh: make v_get_proj_from_dir use gitdir.list if needed
commitd5a485cd6a806ddd9cdf8c9415008570d98086c1
authorKyle J. McKay <mackyle@gmail.com>
Wed, 8 Jul 2020 06:05:46 +0000 (7 23:05 -0700)
committerKyle J. McKay <mackyle@gmail.com>
Wed, 8 Jul 2020 06:05:46 +0000 (7 23:05 -0700)
treece6badc275aa54c76c8ad131e25094aa3cd67891
parent66c2bbb7e6057fad0ce9087b793c6f795e23fd9d
shlib.sh: make v_get_proj_from_dir use gitdir.list if needed

When translating a directory back into a relative project directory,
make use of the `gitdir.list` file if the translation apparently
involves symbolic links to a location outside of $reporoot.

If that fails, go ahead and use the same _external fallback as before.

In addition, if somehow the simple check ends up with a "worktrees"
subdirectory, prune that part off.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
shlib.sh