Skip to content

Commit 4a556b4

Browse files
committed
Use switch command instead of fetch + checkout
1 parent ceda828 commit 4a556b4

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Tasks/UnityBuild/UnityBuildV3/unity-versioning.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ export class UnityVersioning {
251251

252252
let gitTag: string | "" = "";
253253

254-
// Does the user want to commit changes to the repositoryß
254+
// Does the user want to commit changes to the repository?
255255
if (commitChanges) {
256256
const commitChangesUserName = tl.getInput(
257257
projectVersioningCommitChangesUserNameVariableName,
@@ -277,12 +277,11 @@ export class UnityVersioning {
277277
buildCode
278278
);
279279

280-
// Since Azure Pipelines will by default to a shallow clone
280+
// Since Azure Pipelines will by default do a shallow clone
281281
// we must first explicitly switch to the source branch prior to commiting
282282
// changes and pushing.
283283
const sourceBranchName = tl.getVariable("Build.SourceBranchName")!;
284-
tl.execSync("git", ["fetch", "origin", sourceBranchName]);
285-
tl.execSync("git", ["checkout", sourceBranchName]);
284+
tl.execSync("git", ["switch", sourceBranchName]);
286285

287286
// Now we can commit the changes.
288287
tl.execSync("git", ["config", "user.name", commitChangesUserName]);

0 commit comments

Comments
 (0)