Skip to content

Commit

Permalink
chore: formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
renatav committed Sep 18, 2024
1 parent ffa01d3 commit 372ded8
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,9 @@ def test_mixed_target_repo_states(origin_auth_repo, client_dir):
],
indirect=True,
)
def test_update_when_unauthenticated_allowed_different_commits_on_remote(origin_auth_repo, client_dir):
def test_update_when_unauthenticated_allowed_different_commits_on_remote(
origin_auth_repo, client_dir
):
clone_repositories(
origin_auth_repo,
client_dir,
Expand All @@ -323,4 +325,3 @@ def test_update_when_unauthenticated_allowed_different_commits_on_remote(origin_
force=True,
num_of_commits_to_remove=1,
)

4 changes: 3 additions & 1 deletion taf/tests/test_updater/update_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,9 @@ def _get_head_commit_shas(client_repos, num_of_commits_to_remove=0):
)
else:
all_commits = repo.all_commits_on_branch(branch)
start_head_shas[repo_rel_path][branch] = all_commits[-num_of_commits_to_remove-1]
start_head_shas[repo_rel_path][branch] = all_commits[
-num_of_commits_to_remove - 1
]
return start_head_shas


Expand Down
23 changes: 15 additions & 8 deletions taf/updater/updater_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,8 +459,9 @@ def check_if_local_repositories_clean(self):
)
dirty_index_repos.append(auth_repo.name)


unpushed_commits = auth_repo.branch_unpushed_commits(auth_repo.default_branch)
unpushed_commits = auth_repo.branch_unpushed_commits(
auth_repo.default_branch
)
if unpushed_commits:
if self.force:
taf_logger.info(
Expand Down Expand Up @@ -499,7 +500,9 @@ def check_if_local_repositories_clean(self):
taf_logger.info(
f"Resetting repository {repository.name} to clean state for a forced update."
)
_remove_unpushed_commtis(repository, branch, unpushed_commits)
_remove_unpushed_commtis(
repository, branch, unpushed_commits
)
else:
unpushed_commits_repos_and_branches.append(
(repository.name, branch)
Expand Down Expand Up @@ -735,7 +738,9 @@ def validate_commit_in_remote(repo, commit_sha):
f"Last validated commit {last_validated_commit} is not in the remote repository."
)
else:
import pdb; pdb.set_trace()
import pdb

pdb.set_trace()
# Re-validate from the point of divergence
commits_since = validation_repo.all_commits_since_commit(
since_commit=last_validated_commit, branch=branch
Expand Down Expand Up @@ -1026,15 +1031,19 @@ def fetch_commits(repository, branch, old_head):
fetched_commits.index(old_head) + 1 :
]
else:
import pdb; pdb.set_trace()
import pdb

pdb.set_trace()
fetched_commits_on_target_repo_branch = (
repository.all_commits_since_commit(old_head, branch)
)
for commit in fetched_commits:
if commit not in fetched_commits_on_target_repo_branch:
fetched_commits_on_target_repo_branch.append(commit)
else:
import pdb; pdb.set_trace()
import pdb

pdb.set_trace()
fetched_commits_on_target_repo_branch = (
repository.all_commits_since_commit(old_head, branch)
)
Expand Down Expand Up @@ -1816,5 +1825,3 @@ def _merge_commit(repository, branch, commit_to_merge, force_revert=True):
format_commit(commit_to_merge),
branch,
)


0 comments on commit 372ded8

Please sign in to comment.