Is your feature request related to a problem? Please describe.
I have installed Git for Windows which comes with Git BASH, and ugit prints a warning when executed at the top-level directory of the working tree.
$ mkdir ~/git-repo
$ cd ~/git-repo
$ git init
$ ugit
ugit: Not inside top level dir C:/Users/thecesrom/git-repo
Undo your last oopsie in Git 🙈️
Press ctrl+c to exit anytime
This is because in Git BASH for Windows $(pwd) is a "UNIX" path, and git rev-parse --show-toplevel is a Windows path.
Describe the solution you'd like
After reading Git's documentation for rev-parse I have found a suitable option, and I have a PR #22 ready if you're interested.
In this case git rev-parse --show-cdup is a suitable alternative.
--show-cdup
When the command is invoked from a subdirectory, show the path of the top-level directory relative to the current directory (typically a sequence of "../", or an empty string).
Is your feature request related to a problem? Please describe. I have installed Git for Windows which comes with Git BASH, and
ugit
prints a warning when executed at the top-level directory of the working tree.This is because in Git BASH for Windows
$(pwd)
is a "UNIX" path, andgit rev-parse --show-toplevel
is a Windows path.Describe the solution you'd like After reading Git's documentation for
rev-parse
I have found a suitable option, and I have a PR #22 ready if you're interested.In this case
git rev-parse --show-cdup
is a suitable alternative.See: https://git-scm.com/docs/git-rev-parse#Documentation/git-rev-parse.txt---show-cdup
git rev-parse --show-cdup
will only return an empty string if we are at the top-level directory.Describe alternatives you've considered None.
Additional context N/A