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

Commit

Permalink
Fixed a bug with project PUTs without commit SHAs (#10942)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
barankyle authored Aug 13, 2024
1 parent 8161d72 commit 5e3ed4f
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1452,6 +1452,7 @@ export const updateProject = async (
try {
const branchExists = await git.raw(['ls-remote', '--heads', repoPath, `${branchName}`])
if (data.commitSHA) await git.checkout(data.commitSHA)
else if (data.sourceBranch) await git.checkout(data.sourceBranch)
if (branchExists.length === 0 || data.reset) {
try {
await git.deleteLocalBranch(branchName)
Expand Down

0 comments on commit 5e3ed4f

Please sign in to comment.