mirror of
https://github.com/powerline/powerline.git
synced 2025-09-23 18:08:52 +02:00
parent
138611412e
commit
abb4ed4efc
@ -33,6 +33,8 @@ def git_directory(directory):
|
|||||||
if not raw.startswith(b'gitdir: '):
|
if not raw.startswith(b'gitdir: '):
|
||||||
raise IOError('invalid gitfile format')
|
raise IOError('invalid gitfile format')
|
||||||
raw = raw[8:].decode(sys.getfilesystemencoding() or 'utf-8')
|
raw = raw[8:].decode(sys.getfilesystemencoding() or 'utf-8')
|
||||||
|
if raw[-1] == '\n':
|
||||||
|
raw = raw[:-1]
|
||||||
if not raw:
|
if not raw:
|
||||||
raise IOError('no path in gitfile')
|
raise IOError('no path in gitfile')
|
||||||
return os.path.abspath(os.path.join(directory, raw))
|
return os.path.abspath(os.path.join(directory, raw))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user