update
This commit is contained in:
parent
52fbc871b2
commit
da5a86620e
3 changed files with 20 additions and 9 deletions
|
@ -29,6 +29,7 @@ class GitFetch(FactBase):
|
|||
|
||||
class GitRevListComparison(FactBase):
|
||||
def command(self, repo: str, branch: str):
|
||||
assert branch
|
||||
return f"git -C {repo} rev-list HEAD..origin/{branch} | wc -l"
|
||||
|
||||
def process(self, output):
|
||||
|
@ -122,7 +123,7 @@ def repo(
|
|||
# always fetch upstream branches (that way we can compare if the latest
|
||||
# commit has changed, and then we don't need to execute anything!)
|
||||
host.get_fact(GitFetch, repo=dest)
|
||||
stdout = host.get_fact(GitRevListComparison, repo=dest, branch=branch)
|
||||
stdout = host.get_fact(GitRevListComparison, repo=dest, branch=current_branch)
|
||||
repository_has_updates = stdout[0] != "0"
|
||||
|
||||
# since we immediately always fetch, we will always be modifying the
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue