Skip to content

Commit

Permalink
use -shorstat option
Browse files Browse the repository at this point in the history
this will prevent unidcode errors in the `diff` output and will
detect changes
  • Loading branch information
basvandervlies committed Aug 12, 2024
1 parent 284cdb6 commit eb8af73
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions promise-types/git/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ def evaluate_promise(self, promiser: str, attributes: Dict, metadata: Dict):
[
model.executable,
"diff",
"--shortstat",
"..{remote}/{version}".format(
remote=model.remote, version=model.version
),
Expand Down Expand Up @@ -236,21 +237,16 @@ def evaluate_promise(self, promiser: str, attributes: Dict, metadata: Dict):

def _git(self, model: object, args: List[str], cwd: Optional[str] = None) -> str:
self.log_verbose("Run: {cmd}".format(cmd=" ".join(args)))
try:
output = (
subprocess.check_output(
args,
env=self._git_envvars(model),
cwd=cwd,
stderr=subprocess.PIPE,
)
.strip()
.decode("utf-8")
output = (
subprocess.check_output(
args,
env=self._git_envvars(model),
cwd=cwd,
stderr=subprocess.PIPE,
)
except UnicodeDecodeError:
output = "Could not decode output, just continue"
pass

.strip()
.decode("utf-8")
)
output != "" and self.log_verbose(output)
return output

Expand Down

0 comments on commit eb8af73

Please sign in to comment.