@@ -23,6 +23,7 @@ import {
2323 UnityVersioningTools ,
2424} from "@dinomite-studios/unity-azure-pipelines-tasks-lib" ;
2525import { BuildPlatform } from "./build-platform" ;
26+ import path = require( "path" ) ;
2627
2728enum VersioningMode {
2829 None = "none" ,
@@ -57,7 +58,7 @@ export class UnityVersioning {
5758 // HEAD state. So we must make sure to switch to the source branch before
5859 // making any changes to the repository.
5960 const sourceBranchName = tl . getVariable ( "Build.SourceBranchName" ) ! ;
60- tl . execSync ( "git" , [ "switch" , sourceBranchName ] ) ;
61+ tl . execSync ( "git" , [ "switch" , "-c" , sourceBranchName ] ) ;
6162 }
6263
6364 // Does the user want to modify the bundle version?
@@ -294,7 +295,10 @@ export class UnityVersioning {
294295 // Now we can commit the changes.
295296 tl . execSync ( "git" , [ "config" , "user.name" , commitChangesUserName ] ) ;
296297 tl . execSync ( "git" , [ "config" , "user.email" , commitChangesUserMail ] ) ;
297- tl . execSync ( "git" , [ "add" , "." ] ) ;
298+ tl . execSync ( "git" , [
299+ "add" ,
300+ path . join ( projectPath , "ProjectSettings" , "ProjectSettings.asset" ) ,
301+ ] ) ;
298302 tl . execSync ( "git" , [ "commit" , `-m ${ commitMessage } ` ] ) ;
299303
300304 // Since we pushed to the repository, does the user also want to create a tag?
0 commit comments