Skip to content

Commit 9684323

Browse files
committed
Fix Windows compatibility
1 parent 14a4adc commit 9684323

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

setuptools_git_versioning.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,14 @@ def get_tag(): # type: () -> Optional[str]
6262

6363

6464
def get_sha(name='HEAD'): # type: (str) -> Optional[str]
65-
sha = _exec("git rev-list -n 1 {name}".format(name=name))
65+
sha = _exec("git rev-list -n 1 \"{name}\"".format(name=name))
6666
if sha:
6767
return sha[0]
6868
return None
6969

7070

7171
def get_latest_file_commit(path): # type: (str) -> Optional[str]
72-
sha = _exec("git log -n 1 --pretty=format:%H -- {path}".format(path=path))
72+
sha = _exec("git log -n 1 --pretty=format:%H -- \"{path}\"".format(path=path))
7373
if sha:
7474
return sha[0]
7575
return None
@@ -83,7 +83,7 @@ def is_dirty(): # type: () -> bool
8383

8484

8585
def count_since(name): # type: (str) -> Optional[int]
86-
res = _exec("git rev-list --count HEAD ^{name}".format(name=name))
86+
res = _exec("git rev-list --count HEAD \"^{name}\"".format(name=name))
8787
if res:
8888
return int(res[0])
8989
return None

0 commit comments

Comments
 (0)