Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@


## Unreleased
### Fixed
- ephemeral git context push rejection when concurrent processes push to the same branch - pull before push to integrate remote changes


## 1.2.0
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Unreleased:
added: []
fixed: []
fixed:
- ephemeral git context push rejection when concurrent processes push to the same branch - pull before push to integrate remote changes
changed: []
deprecated: []
removed: []
Expand Down
6 changes: 6 additions & 0 deletions src/ctl/util/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -1148,6 +1148,12 @@ def finalize(self, exc_type, exc_val, exc_tb):
self.git_manager.changed_files(self.state.files_to_add)
)
self.git_manager.commit(self.state.commit_message)
# Pull to integrate any remote changes before pushing,
# avoiding rejection when concurrent processes have
# pushed to the same branch
# If this fails due to conflicts, push would have also failed.
if not self.state.force_push:
self.git_manager.pull()
# Attempt to push
self.git_manager.push(force=self.state.force_push)

Expand Down
Loading