Skip to content
Merged
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
20 changes: 11 additions & 9 deletions __tests__/utils/command.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ describe('clone', () => {

execCalledWith(mockExec, [
'git init \'.\'',
'git remote add origin \'https://octocat:test-token@github.com/hello/world.git\' > /dev/null 2>&1 || :',
'git remote add origin \'https://octocat:test-token@github.com/hello/world.git\' || :',
'git fetch --no-tags origin \'refs/heads/hello-world/test-branch:refs/remotes/origin/hello-world/test-branch\' || :',
'git reset --hard || :',
'git checkout -b hello-world/test-branch origin/hello-world/test-branch || :',
Expand All @@ -115,6 +115,7 @@ describe('clone', () => {
'[command]git init \'.\'',
' >> stdout',
'[command]git remote add origin',
' >> stdout',
'[command]git fetch --no-tags origin \'refs/heads/hello-world/test-branch:refs/remotes/origin/hello-world/test-branch\'',
' >> stdout',
'[command]git reset --hard',
Expand Down Expand Up @@ -162,7 +163,7 @@ describe('checkBranch', () => {

execCalledWith(mockExec, [
'git rev-parse --abbrev-ref HEAD || :',
'git remote add origin \'https://octocat:test-token@github.com/hello/world.git\' > /dev/null 2>&1 || :',
'git remote add origin \'https://octocat:test-token@github.com/hello/world.git\' || :',
'git fetch --no-tags origin \'refs/heads/feature/new-feature:refs/remotes/origin/feature/new-feature\' || :',
'git checkout -b feature/new-feature origin/feature/new-feature || :',
'git checkout feature/new-feature || :',
Expand Down Expand Up @@ -707,6 +708,7 @@ describe('updatePr', () => {
'::endgroup::',
'::group::Pushing to hello/world@test...',
'[command]git push origin test:refs/heads/test',
' >> stdout',
]);
});
});
Expand Down Expand Up @@ -834,12 +836,12 @@ describe('resolveConflicts', () => {

execCalledWith(mockExec, [
'git init \'.\'',
'git remote add origin \'https://octocat:test-token@github.com/hello/world.git\' > /dev/null 2>&1 || :',
'git remote add origin \'https://octocat:test-token@github.com/hello/world.git\' || :',
'git fetch --no-tags origin \'refs/heads/feature/new-feature:refs/remotes/origin/feature/new-feature\' || :',
'git config \'user.name\' \'GitHub Actions\'',
'git config \'user.email\' \'example@example.com\'',
'git merge --no-edit origin/feature/new-feature || :',
'git push origin \'test:refs/heads/test\' > /dev/null 2>&1 || :',
'git push origin \'test:refs/heads/test\' || :',
]);
});

Expand Down Expand Up @@ -869,14 +871,14 @@ describe('resolveConflicts', () => {

execCalledWith(mockExec, [
'git init \'.\'',
'git remote add origin \'https://octocat:test-token@github.com/hello/world.git\' > /dev/null 2>&1 || :',
'git remote add origin \'https://octocat:test-token@github.com/hello/world.git\' || :',
'git fetch --no-tags origin \'refs/heads/feature/new-feature:refs/remotes/origin/feature/new-feature\' || :',
'git config \'user.name\' \'GitHub Actions\'',
'git config \'user.email\' \'example@example.com\'',
'git merge --no-edit origin/feature/new-feature || :',
`rm -rdf ${workDir}`,
'git init \'.\'',
'git remote add origin \'https://octocat:test-token@github.com/hello/world.git\' > /dev/null 2>&1 || :',
'git remote add origin \'https://octocat:test-token@github.com/hello/world.git\' || :',
'git fetch --no-tags origin \'refs/heads/feature/new-feature:refs/remotes/origin/feature/new-feature\' || :',
'git checkout -b feature/new-feature origin/feature/new-feature || :',
'git checkout feature/new-feature || :',
Expand Down Expand Up @@ -923,14 +925,14 @@ describe('resolveConflicts', () => {

execCalledWith(mockExec, [
'git init \'.\'',
'git remote add origin \'https://octocat:test-token@github.com/hello/world.git\' > /dev/null 2>&1 || :',
'git remote add origin \'https://octocat:test-token@github.com/hello/world.git\' || :',
'git fetch --no-tags origin \'refs/heads/feature/new-feature:refs/remotes/origin/feature/new-feature\' || :',
'git config \'user.name\' \'GitHub Actions\'',
'git config \'user.email\' \'example@example.com\'',
'git merge --no-edit origin/feature/new-feature || :',
`rm -rdf ${workDir}`,
'git init \'.\'',
'git remote add origin \'https://octocat:test-token@github.com/hello/world.git\' > /dev/null 2>&1 || :',
'git remote add origin \'https://octocat:test-token@github.com/hello/world.git\' || :',
'git fetch --no-tags origin \'refs/heads/feature/new-feature:refs/remotes/origin/feature/new-feature\' || :',
'git checkout -b feature/new-feature origin/feature/new-feature || :',
'git checkout feature/new-feature || :',
Expand All @@ -942,7 +944,7 @@ describe('resolveConflicts', () => {
'git config \'user.email\' \'example@example.com\'',
'git commit -qm \'commit message\'',
'git show \'--stat-count=10\' HEAD',
'git push --force origin \'test:refs/heads/test\' > /dev/null 2>&1 || :',
'git push --force origin \'test:refs/heads/test\' || :',
]);
});
});
Expand Down
16 changes: 11 additions & 5 deletions __tests__/utils/process1.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ describe('execute', () => {
'[command]git status --short -uno',
'> There is no diff.',
'> Checking references diff...',
'[command]git fetch --prune --no-recurse-submodules origin +refs/heads/master:refs/remotes/origin/master',
'[command]git fetch --prune --no-tags --no-recurse-submodules origin +refs/heads/master:refs/remotes/origin/master',
'[command]git diff \'HEAD..origin/master\' --name-only',
'> Closing PullRequest... [change/new-topic1]',
'> Deleting reference... [refs/heads/change/new-topic1]',
Expand Down Expand Up @@ -229,7 +229,7 @@ describe('execute', () => {
'[command]git show \'--stat-count=10\' HEAD',
'::endgroup::',
'::group::Checking references diff...',
'[command]git fetch --prune --no-recurse-submodules origin +refs/heads/feature/new-feature:refs/remotes/origin/feature/new-feature',
'[command]git fetch --prune --no-tags --no-recurse-submodules origin +refs/heads/feature/new-feature:refs/remotes/origin/feature/new-feature',
'[command]git diff \'HEAD..origin/feature/new-feature\' --name-only',
'::endgroup::',
'::group::Closing PullRequest... [Hello-World/test-21031067]',
Expand Down Expand Up @@ -277,6 +277,7 @@ describe('execute', () => {
stdoutCalledWith(mockStdout, [
'::group::Fetching...',
'[command]git remote add origin',
' >> stdout',
'[command]git fetch --no-tags origin \'refs/heads/Hello-World/test-21031067:refs/remotes/origin/Hello-World/test-21031067\'',
' >> stdout',
'[command]git reset --hard',
Expand All @@ -294,6 +295,7 @@ describe('execute', () => {
'::endgroup::',
'::group::Cloning [feature/new-feature] from the remote repo...',
'[command]git remote add origin',
' >> stdout',
'[command]git fetch --no-tags origin \'refs/heads/feature/new-feature:refs/remotes/origin/feature/new-feature\'',
' >> stdout',
'[command]git checkout -b feature/new-feature origin/feature/new-feature',
Expand All @@ -316,7 +318,8 @@ describe('execute', () => {
'> There is no diff.',
'::endgroup::',
'::group::Checking references diff...',
'[command]git fetch --prune --no-recurse-submodules origin +refs/heads/feature/new-feature:refs/remotes/origin/feature/new-feature',
'[command]git fetch --prune --no-tags --no-recurse-submodules origin +refs/heads/feature/new-feature:refs/remotes/origin/feature/new-feature',
' >> stdout',
'[command]git diff \'HEAD..origin/feature/new-feature\' --name-only',
'::endgroup::',
'::group::Closing PullRequest... [Hello-World/test-21031067]',
Expand Down Expand Up @@ -448,7 +451,7 @@ describe('execute', () => {
'[command]git commit -qm \'test: create pull request\'',
'[command]git show \'--stat-count=10\' HEAD',
'> Checking references diff...',
'[command]git fetch --prune --no-recurse-submodules origin +refs/heads/master:refs/remotes/origin/master',
'[command]git fetch --prune --no-tags --no-recurse-submodules origin +refs/heads/master:refs/remotes/origin/master',
'[command]git diff \'HEAD..origin/master\' --name-only',
'> Closing PullRequest... [change/new-topic1]',
'> Deleting reference... [refs/heads/change/new-topic1]',
Expand Down Expand Up @@ -626,6 +629,7 @@ describe('execute', () => {
stdoutCalledWith(mockStdout, [
'::group::Fetching...',
'[command]git remote add origin',
' >> stdout',
'[command]git fetch --no-tags origin \'refs/heads/Hello-World/test-21031067:refs/remotes/origin/Hello-World/test-21031067\'',
' >> stdout',
'[command]git reset --hard',
Expand All @@ -643,6 +647,7 @@ describe('execute', () => {
'::endgroup::',
'::group::Cloning [feature/new-feature] from the remote repo...',
'[command]git remote add origin',
' >> stdout',
'[command]git fetch --no-tags origin \'refs/heads/feature/new-feature:refs/remotes/origin/feature/new-feature\'',
' >> stdout',
'[command]git checkout -b feature/new-feature origin/feature/new-feature',
Expand All @@ -665,7 +670,8 @@ describe('execute', () => {
'> There is no diff.',
'::endgroup::',
'::group::Checking references diff...',
'[command]git fetch --prune --no-recurse-submodules origin +refs/heads/feature/new-feature:refs/remotes/origin/feature/new-feature',
'[command]git fetch --prune --no-tags --no-recurse-submodules origin +refs/heads/feature/new-feature:refs/remotes/origin/feature/new-feature',
' >> stdout',
'[command]git diff \'HEAD..origin/feature/new-feature\' --name-only',
'::set-output name=result::not changed',
'::endgroup::',
Expand Down
Loading