Skip to content

Commit

Permalink
Normalize case before comparing paths
Browse files Browse the repository at this point in the history
Closes #233
  • Loading branch information
sch0125 committed Nov 30, 2020
1 parent b7d5317 commit 0e5ef31
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions gitman/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,16 +113,19 @@ def valid():
return False

log.debug("Checking for a valid git top level...")
gittoplevel = git('rev-parse', '--show-toplevel', _show=False)
currentdir = pwd(_show=False)
gittoplevel = os.path.normpath(
os.path.normcase(git('rev-parse', '--show-toplevel', _show=False)[0])
)

currentdir = os.path.normpath(os.path.normcase(pwd(_show=False)))
status = False
if gittoplevel[0] == currentdir:

if gittoplevel == currentdir:
status = True
else:
log.debug(
"git top level: %s != current working directory: %s",
gittoplevel[0],
gittoplevel,
currentdir,
)
status = False
Expand Down

0 comments on commit 0e5ef31

Please sign in to comment.