Skip to content

Commit 240f25f

Browse files
committed
pull before push when finalizing eph git context
1 parent 4d6fd5f commit 240f25f

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/ctl/util/git.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1148,6 +1148,12 @@ def finalize(self, exc_type, exc_val, exc_tb):
11481148
self.git_manager.changed_files(self.state.files_to_add)
11491149
)
11501150
self.git_manager.commit(self.state.commit_message)
1151+
# Pull to integrate any remote changes before pushing,
1152+
# avoiding rejection when concurrent processes have
1153+
# pushed to the same branch
1154+
# If this fails due to conflicts, push would have also failed.
1155+
if not self.state.force_push:
1156+
self.git_manager.pull()
11511157
# Attempt to push
11521158
self.git_manager.push(force=self.state.force_push)
11531159

0 commit comments

Comments
 (0)