From ebd147b43ee98e44139adfcfac83ee807fba0655 Mon Sep 17 00:00:00 2001 From: William Martin Date: Thu, 13 Mar 2025 14:59:19 +0100 Subject: [PATCH] Use verbose upstream setting --- .../testdata/pr/pr-create-respects-branch-pushremote.txtar | 5 +++-- .../testdata/pr/pr-create-respects-remote-pushdefault.txtar | 5 +++-- .../testdata/pr/pr-create-respects-simple-pushdefault.txtar | 3 ++- .../pr/pr-create-respects-user-colon-branch-syntax.txtar | 5 +++-- .../pr/pr-view-status-respects-branch-pushremote.txtar | 3 ++- .../pr/pr-view-status-respects-remote-pushdefault.txtar | 3 ++- .../pr/pr-view-status-respects-simple-pushdefault.txtar | 3 ++- 7 files changed, 17 insertions(+), 10 deletions(-) diff --git a/acceptance/testdata/pr/pr-create-respects-branch-pushremote.txtar b/acceptance/testdata/pr/pr-create-respects-branch-pushremote.txtar index c191fba2e..189caaf9e 100644 --- a/acceptance/testdata/pr/pr-create-respects-branch-pushremote.txtar +++ b/acceptance/testdata/pr/pr-create-respects-branch-pushremote.txtar @@ -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} \ No newline at end of file +stdout {"baseRefName":"main","headRefName":"feature-branch","headRepository":{"id":"${FORK_ID}","name":"${FORK}"},"isCrossRepository":true} diff --git a/acceptance/testdata/pr/pr-create-respects-remote-pushdefault.txtar b/acceptance/testdata/pr/pr-create-respects-remote-pushdefault.txtar index 323f955f4..2b4b28809 100644 --- a/acceptance/testdata/pr/pr-create-respects-remote-pushdefault.txtar +++ b/acceptance/testdata/pr/pr-create-respects-remote-pushdefault.txtar @@ -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} \ No newline at end of file +stdout {"baseRefName":"main","headRefName":"feature-branch","headRepository":{"id":"${FORK_ID}","name":"${FORK}"},"isCrossRepository":true} diff --git a/acceptance/testdata/pr/pr-create-respects-simple-pushdefault.txtar b/acceptance/testdata/pr/pr-create-respects-simple-pushdefault.txtar index ca420bac2..63d3ae2b4 100644 --- a/acceptance/testdata/pr/pr-create-respects-simple-pushdefault.txtar +++ b/acceptance/testdata/pr/pr-create-respects-simple-pushdefault.txtar @@ -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 diff --git a/acceptance/testdata/pr/pr-create-respects-user-colon-branch-syntax.txtar b/acceptance/testdata/pr/pr-create-respects-user-colon-branch-syntax.txtar index d9b22a023..097775cbd 100644 --- a/acceptance/testdata/pr/pr-create-respects-user-colon-branch-syntax.txtar +++ b/acceptance/testdata/pr/pr-create-respects-user-colon-branch-syntax.txtar @@ -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} \ No newline at end of file +stdout {"baseRefName":"main","headRefName":"feature-branch","headRepository":{"id":"${FORK_ID}","name":"${FORK}"},"isCrossRepository":true} diff --git a/acceptance/testdata/pr/pr-view-status-respects-branch-pushremote.txtar b/acceptance/testdata/pr/pr-view-status-respects-branch-pushremote.txtar index ef80cd8ba..f0bb0e6e7 100644 --- a/acceptance/testdata/pr/pr-view-status-respects-branch-pushremote.txtar +++ b/acceptance/testdata/pr/pr-view-status-respects-branch-pushremote.txtar @@ -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 diff --git a/acceptance/testdata/pr/pr-view-status-respects-remote-pushdefault.txtar b/acceptance/testdata/pr/pr-view-status-respects-remote-pushdefault.txtar index 8bfac2837..a3d376b80 100644 --- a/acceptance/testdata/pr/pr-view-status-respects-remote-pushdefault.txtar +++ b/acceptance/testdata/pr/pr-view-status-respects-remote-pushdefault.txtar @@ -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 diff --git a/acceptance/testdata/pr/pr-view-status-respects-simple-pushdefault.txtar b/acceptance/testdata/pr/pr-view-status-respects-simple-pushdefault.txtar index 114f401ec..b9621ea72 100644 --- a/acceptance/testdata/pr/pr-view-status-respects-simple-pushdefault.txtar +++ b/acceptance/testdata/pr/pr-view-status-respects-simple-pushdefault.txtar @@ -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'