Use verbose upstream setting
This commit is contained in:
parent
028caa3823
commit
ebd147b43e
7 changed files with 17 additions and 10 deletions
|
|
@ -33,7 +33,8 @@ exec gh repo clone ${USER}/${FORK}
|
|||
cd ${FORK}
|
||||
|
||||
# Prepare a branch where changes are pulled from the upstream default branch but pushed to fork
|
||||
exec git checkout -b feature-branch upstream/main
|
||||
exec git checkout -b feature-branch
|
||||
exec git branch --set-upstream-to upstream/main
|
||||
exec git config branch.feature-branch.pushRemote origin
|
||||
exec git config unset remote.upstream.gh-resolved
|
||||
exec git commit --allow-empty -m 'Empty Commit'
|
||||
|
|
@ -45,4 +46,4 @@ stdout https://${GH_HOST}/${ORG}/${REPO}/pull/1
|
|||
|
||||
# Assert that the PR was created with the correct head repository and refs
|
||||
exec gh pr view --json headRefName,headRepository,baseRefName,isCrossRepository
|
||||
stdout {"baseRefName":"main","headRefName":"feature-branch","headRepository":{"id":"${FORK_ID}","name":"${FORK}"},"isCrossRepository":true}
|
||||
stdout {"baseRefName":"main","headRefName":"feature-branch","headRepository":{"id":"${FORK_ID}","name":"${FORK}"},"isCrossRepository":true}
|
||||
|
|
|
|||
|
|
@ -33,7 +33,8 @@ exec gh repo clone ${USER}/${FORK}
|
|||
cd ${FORK}
|
||||
|
||||
# Prepare a branch where changes are pulled from the upstream default branch but pushed to fork
|
||||
exec git checkout -b feature-branch upstream/main
|
||||
exec git checkout -b feature-branch
|
||||
exec git branch --set-upstream-to upstream/main
|
||||
exec git config remote.pushDefault origin
|
||||
exec git config unset remote.upstream.gh-resolved
|
||||
exec git commit --allow-empty -m 'Empty Commit'
|
||||
|
|
@ -45,4 +46,4 @@ stdout https://${GH_HOST}/${ORG}/${REPO}/pull/1
|
|||
|
||||
# Assert that the PR was created with the correct head repository and refs
|
||||
exec gh pr view --json headRefName,headRepository,baseRefName,isCrossRepository
|
||||
stdout {"baseRefName":"main","headRefName":"feature-branch","headRepository":{"id":"${FORK_ID}","name":"${FORK}"},"isCrossRepository":true}
|
||||
stdout {"baseRefName":"main","headRefName":"feature-branch","headRepository":{"id":"${FORK_ID}","name":"${FORK}"},"isCrossRepository":true}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,8 @@ cd ${REPO}
|
|||
exec git config push.default simple
|
||||
|
||||
# Prepare a branch where changes are pulled from the default branch instead of remote branch of same name
|
||||
exec git checkout -b feature-branch origin/main
|
||||
exec git checkout -b feature-branch
|
||||
exec git branch --set-upstream-to origin/main
|
||||
exec git commit --allow-empty -m 'Empty Commit'
|
||||
exec git push origin feature-branch
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,8 @@ exec gh repo clone ${USER}/${FORK}
|
|||
cd ${FORK}
|
||||
|
||||
# Prepare a branch where changes are pulled from the upstream default branch but pushed to fork
|
||||
exec git checkout -b feature-branch upstream/main
|
||||
exec git checkout -b feature-branch
|
||||
exec git branch --set-upstream-to upstream/main
|
||||
exec git commit --allow-empty -m 'Empty Commit'
|
||||
exec git push origin feature-branch
|
||||
|
||||
|
|
@ -43,4 +44,4 @@ stdout https://${GH_HOST}/${ORG}/${REPO}/pull/1
|
|||
|
||||
# Assert that the PR was created with the correct head repository and refs
|
||||
exec gh pr view ${USER}:feature-branch --json headRefName,headRepository,baseRefName,isCrossRepository
|
||||
stdout {"baseRefName":"main","headRefName":"feature-branch","headRepository":{"id":"${FORK_ID}","name":"${FORK}"},"isCrossRepository":true}
|
||||
stdout {"baseRefName":"main","headRefName":"feature-branch","headRepository":{"id":"${FORK_ID}","name":"${FORK}"},"isCrossRepository":true}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,8 @@ exec gh repo clone ${ORG}/${FORK}
|
|||
cd ${FORK}
|
||||
|
||||
# Prepare a branch where changes are pulled from the upstream default branch but pushed to fork
|
||||
exec git checkout -b feature-branch upstream/main
|
||||
exec git checkout -b feature-branch
|
||||
exec git branch --set-upstream-to upstream/main
|
||||
exec git config branch.feature-branch.pushRemote origin
|
||||
exec git commit --allow-empty -m 'Empty Commit'
|
||||
exec git push
|
||||
|
|
|
|||
|
|
@ -27,7 +27,8 @@ exec gh repo clone ${ORG}/${FORK}
|
|||
cd ${FORK}
|
||||
|
||||
# Prepare a branch where changes are pulled from the upstream default branch but pushed to fork
|
||||
exec git checkout -b feature-branch upstream/main
|
||||
exec git checkout -b feature-branch
|
||||
exec git branch --set-upstream-to upstream/main
|
||||
exec git config remote.pushDefault origin
|
||||
exec git commit --allow-empty -m 'Empty Commit'
|
||||
exec git push
|
||||
|
|
|
|||
|
|
@ -18,7 +18,8 @@ cd ${REPO}
|
|||
exec git config push.default simple
|
||||
|
||||
# Prepare a branch where changes are pulled from the default branch instead of remote branch of same name
|
||||
exec git checkout -b feature-branch origin/main
|
||||
exec git checkout -b feature-branch
|
||||
exec git branch --set-upstream-to origin/main
|
||||
|
||||
# Create the PR
|
||||
exec git commit --allow-empty -m 'Empty Commit'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue