Skip to content

Commit

Permalink
fix: fix commits per repositories function when same target commits a…
Browse files Browse the repository at this point in the history
…re on different branches (#337)

* fix: fix commits per repositories function when same target commits are on different branches

* chore: update changelog
  • Loading branch information
renatav authored Aug 17, 2023
1 parent cdc2473 commit a3dcc20
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ and this project adheres to [Semantic Versioning][semver].

### Fixed

- fix commits per repositories function when same target commits are on different branches ([337])
- Add missing `write` flag to `taf targets sign` ([329])

[337]: https://github.com/openlawlibrary/taf/pull/337
[330]: https://github.com/openlawlibrary/taf/pull/330
[329]: https://github.com/openlawlibrary/taf/pull/329

Expand Down
9 changes: 6 additions & 3 deletions taf/auth_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,12 @@ def sorted_commits_and_branches_per_repositories(
continue
target_branch = target_data.get("branch")
target_commit = target_data.get("commit")
previous_commit = previous_commits.get(target_path)
previous_data = previous_commits.get(target_path)
target_data.setdefault("custom", {})
if previous_commit is None or target_commit != previous_commit:
if (
previous_data is None
or (target_commit, target_branch) != previous_data
):
if custom_fns is not None and target_path in custom_fns:
target_data["custom"].update(
custom_fns[target_path](target_commit)
Expand All @@ -273,7 +276,7 @@ def sorted_commits_and_branches_per_repositories(
"auth_commit": commit,
}
)
previous_commits[target_path] = target_commit
previous_commits[target_path] = (target_commit, target_branch)
self._log_debug(
f"new commits per repositories according to target files: {repositories_commits}"
)
Expand Down

0 comments on commit a3dcc20

Please sign in to comment.