Skip to content
This repository was archived by the owner on Aug 21, 2024. It is now read-only.

Commit 5e3ed4f

Browse files
authored
Fixed a bug with project PUTs without commit SHAs (#10942)
If a project PUT had a sourceBranch but no commit SHA, it was not checking out anything and staying with the default branch's tip. Now a PUT with a sourceBranch and no SHA checks out that branch. Specifying a commit will always checkout that commit. Resolves IR-3820
1 parent 8161d72 commit 5e3ed4f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

packages/server-core/src/projects/project/project-helper.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1452,6 +1452,7 @@ export const updateProject = async (
14521452
try {
14531453
const branchExists = await git.raw(['ls-remote', '--heads', repoPath, `${branchName}`])
14541454
if (data.commitSHA) await git.checkout(data.commitSHA)
1455+
else if (data.sourceBranch) await git.checkout(data.sourceBranch)
14551456
if (branchExists.length === 0 || data.reset) {
14561457
try {
14571458
await git.deleteLocalBranch(branchName)

0 commit comments

Comments
 (0)