Skip to content

Commit 7f769d6

Browse files
committed
Add -- to git commands to avoid ambiguities (fixes #303)
1 parent 7c5bfa5 commit 7f769d6

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/adapter/git_adapter.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def current_state_command(cls):
124124
raise RuntimeError(
125125
"Do not known how to handle this repository: %s" % cls._repository_url)
126126

127-
return ['git', 'rev-parse', '--short', 'HEAD']
127+
return ['git', 'rev-parse', '--short', 'HEAD', "--"]
128128

129129
@classmethod
130130
def save_state(cls, state):
@@ -157,6 +157,6 @@ def get_updates_list_command(cls):
157157
The list is used to invalidate the cache.
158158
"""
159159
current_state = cls.get_state()
160-
if current_state is None:
161-
return ['git', 'ls-tree', '--full-tree', '-r', '--name-only', 'HEAD']
162-
return ['git', 'diff', '--name-only', current_state, 'HEAD']
160+
if not current_state:
161+
return ['git', 'ls-tree', '--full-tree', '-r', '--name-only', 'HEAD', "--"]
162+
return ['git', 'diff', '--name-only', current_state, 'HEAD', "--"]

lib/fetch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def _update_adapter(adptr):
118118

119119
errorcode, output = _run_cmd(cmd)
120120
if errorcode:
121-
_log("\nERROR:\n---\n" + output + "\n---\nCould not update %s" % adptr)
121+
_log("\nERROR:\n---%s\n" % output.decode("utf-8") + "\n---\nCould not update %s" % adptr)
122122
return False
123123

124124
# Getting current repository state

0 commit comments

Comments
 (0)