Alright, this should work.
This commit is contained in:
parent
cce6fde4ea
commit
04161da5a0
@ -40,12 +40,17 @@ roots = {}
|
|||||||
# Lets not even talk about this.
|
# Lets not even talk about this.
|
||||||
def fixWindowsPath(path):
|
def fixWindowsPath(path):
|
||||||
import ctypes
|
import ctypes
|
||||||
GetLongPathName = ctypes.windll.kernel32.GetLongPathNameW
|
GetShortPathName = ctypes.windll.kernel32.GetShortPathNameW
|
||||||
buffer = ctypes.create_unicode_buffer(260)
|
shortp = ctypes.create_unicode_buffer(260)
|
||||||
rv = GetLongPathName(path.capitalize(), buffer, 260)
|
rv = GetShortPathName(path.capitalize(), shortp, 260)
|
||||||
if rv == 0 or rv > 260:
|
if rv == 0 or rv > 260:
|
||||||
return path
|
return path
|
||||||
return buffer.value
|
GetLongPathName = ctypes.windll.kernel32.GetLongPathNameW
|
||||||
|
longp = ctypes.create_unicode_buffer(260)
|
||||||
|
rv = GetLongPathName(shortp, longp, 260)
|
||||||
|
if rv == 0 or rv > 260:
|
||||||
|
return path
|
||||||
|
return longp.value
|
||||||
|
|
||||||
for i, line in enumerate(lines):
|
for i, line in enumerate(lines):
|
||||||
line = line.strip().split(None, 2)
|
line = line.strip().split(None, 2)
|
||||||
@ -81,9 +86,6 @@ for i, line in enumerate(lines):
|
|||||||
try:
|
try:
|
||||||
root = runCommand(['git', 'rev-parse', '--show-toplevel'])
|
root = runCommand(['git', 'rev-parse', '--show-toplevel'])
|
||||||
|
|
||||||
if os.name == 'nt':
|
|
||||||
root = fixWindowsPath(os.path.normcase(root))
|
|
||||||
|
|
||||||
if root in roots:
|
if root in roots:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user