Skip to content

Commit e8383fa

Browse files
committed
Avoid conflicts in PRs created via os-autoinst-obs-auto-submit
Base the PRs always on the latest version of the target branch (e.g. on `parent/leap-16.0` where parent is the remote `[email protected]:pool/openQA.git` as configured by `git-obs`) to avoid creating PRs that are in conflict. Tested by adding a dummy commit on my forks branch and running the script locally. It created a PR with the dummy commit. Then I ran with script again with the changes of this PR and now the dummy commit is removed resulting in a clean PR. This is visible in the history of https://src.opensuse.org/pool/openQA/pulls/7.
1 parent 53e015c commit e8383fa

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

os-autoinst-obs-auto-submit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,10 @@ make_git_submit_request() {
115115
cd "$package"
116116
$git switch "$branch"
117117

118+
# base our changes on the latest state of the target repository (which is added as remote "parent" by git-obs)
119+
$git fetch parent || return $?
120+
$git reset --hard "parent/$branch"
121+
118122
# remove everything and replace it with the updated files we have just created (in the calling function)
119123
rm -v ./*
120124
cp -v ../../"$package"/* ./

0 commit comments

Comments
 (0)