@@ -93,13 +93,6 @@ public bool TryGetBranchFromBuildNumber( ConsoleHelper console, CiBuildId buildI
9393
9494 branch = build . Attribute ( "branchName" ) ! . Value ;
9595
96- const string prefix = "refs/heads/" ;
97-
98- if ( branch . StartsWith ( prefix , StringComparison . OrdinalIgnoreCase ) )
99- {
100- branch = branch . Substring ( prefix . Length ) ;
101- }
102-
10396 if ( string . IsNullOrEmpty ( branch ) )
10497 {
10598 console . WriteError ( $ "Cannot determine the branch of '{ buildId } ': the branch name is empty." ) ;
@@ -150,11 +143,10 @@ IEnumerable<DownloadedFile> GetFiles( string urlOrPath, string targetDirectory )
150143 . ToArray ( ) ;
151144
152145 IEnumerable < ( string Name , string Url , long Size ) > files = artifacts
153- . Select (
154- a => (
155- a . Name ,
156- a . Element . Element ( "content" ) ? . Attribute ( "href" ) ? . Value ,
157- long . Parse ( a . Element . Attribute ( "size" ) ? . Value ?? "0" , NumberStyles . Integer , CultureInfo . InvariantCulture ) ) )
146+ . Select ( a => (
147+ a . Name ,
148+ a . Element . Element ( "content" ) ? . Attribute ( "href" ) ? . Value ,
149+ long . Parse ( a . Element . Attribute ( "size" ) ? . Value ?? "0" , NumberStyles . Integer , CultureInfo . InvariantCulture ) ) )
158150 . Where ( a => a . Value != null )
159151 . Select ( a => ( a . Name , a . Value ! , a . Item3 ) ) ;
160152
@@ -347,10 +339,13 @@ private bool TryGetDetails( ConsoleHelper console, string path )
347339
348340 public bool TryGetProjectDetails ( ConsoleHelper console , string id ) => this . TryGetDetails ( console , $ "/app/rest/projects/id:{ id } " ) ;
349341
350- public bool TryGetOrderedSubprojectsRecursively ( ConsoleHelper console , string projectId , [ NotNullWhen ( true ) ] out IReadOnlyList < ( string Id , string Name ) > ? subprojects )
342+ public bool TryGetOrderedSubprojectsRecursively (
343+ ConsoleHelper console ,
344+ string projectId ,
345+ [ NotNullWhen ( true ) ] out IReadOnlyList < ( string Id , string Name ) > ? subprojects )
351346 {
352347 subprojects = null ;
353-
348+
354349 if ( ! this . TryGet ( $ "/app/rest/projects/id:{ projectId } ", console , out var projectResponse ) )
355350 {
356351 return false ;
@@ -362,7 +357,7 @@ public bool TryGetOrderedSubprojectsRecursively( ConsoleHelper console, string p
362357 projectRootElement . Element ( "projects" ) ! . Attribute ( "count" ) ! . Value ,
363358 NumberStyles . Integer ,
364359 CultureInfo . InvariantCulture ) ;
365-
360+
366361 var subprojectsList = new List < ( string , string ) > ( ) ;
367362
368363 if ( expectedCount > 0 )
@@ -419,13 +414,16 @@ public bool TryGetOrderedSubprojectsRecursively( ConsoleHelper console, string p
419414 {
420415 throw new InvalidOperationException ( "Not all subprojects have been retrieved." ) ;
421416 }
422-
417+
423418 subprojects = subprojectsList . ToImmutableArray ( ) ;
424419
425420 return true ;
426421 }
427422
428- public bool TryGetProjectsBuildConfigurations ( ConsoleHelper console , string projectId , [ NotNullWhen ( true ) ] out ImmutableArray < string > ? buildConfigurations )
423+ public bool TryGetProjectsBuildConfigurations (
424+ ConsoleHelper console ,
425+ string projectId ,
426+ [ NotNullWhen ( true ) ] out ImmutableArray < string > ? buildConfigurations )
429427 {
430428 int ? expectedCount = null ;
431429 buildConfigurations = null ;
@@ -442,7 +440,10 @@ public bool TryGetProjectsBuildConfigurations( ConsoleHelper console, string pro
442440
443441 var buildConfigurationsRootsElement = buildConfigurationsResponse . Content . ReadAsXDocument ( ) . Root ! ;
444442
445- var newExpectedCount = int . Parse ( buildConfigurationsRootsElement . Attribute ( "count" ) ! . Value , NumberStyles . Integer , CultureInfo . InvariantCulture ) ;
443+ var newExpectedCount = int . Parse (
444+ buildConfigurationsRootsElement . Attribute ( "count" ) ! . Value ,
445+ NumberStyles . Integer ,
446+ CultureInfo . InvariantCulture ) ;
446447
447448 if ( expectedCount == null )
448449 {
@@ -476,8 +477,11 @@ public bool TryGetProjectsBuildConfigurations( ConsoleHelper console, string pro
476477
477478 return true ;
478479 }
479-
480- public bool TryGetBuildConfigurationsSnapshotDependencies ( ConsoleHelper console , string buildConfigurationId , [ NotNullWhen ( true ) ] out ImmutableArray < string > ? snapshotDependencies )
480+
481+ public bool TryGetBuildConfigurationsSnapshotDependencies (
482+ ConsoleHelper console ,
483+ string buildConfigurationId ,
484+ [ NotNullWhen ( true ) ] out ImmutableArray < string > ? snapshotDependencies )
481485 {
482486 int ? expectedCount = null ;
483487 snapshotDependencies = null ;
@@ -494,7 +498,10 @@ public bool TryGetBuildConfigurationsSnapshotDependencies( ConsoleHelper console
494498
495499 var snapshotDependenciesRootsElement = snapshotDependenciesResponse . Content . ReadAsXDocument ( ) . Root ! ;
496500
497- var newExpectedCount = int . Parse ( snapshotDependenciesRootsElement . Attribute ( "count" ) ! . Value , NumberStyles . Integer , CultureInfo . InvariantCulture ) ;
501+ var newExpectedCount = int . Parse (
502+ snapshotDependenciesRootsElement . Attribute ( "count" ) ! . Value ,
503+ NumberStyles . Integer ,
504+ CultureInfo . InvariantCulture ) ;
498505
499506 if ( expectedCount == null )
500507 {
@@ -528,7 +535,7 @@ public bool TryGetBuildConfigurationsSnapshotDependencies( ConsoleHelper console
528535
529536 return true ;
530537 }
531-
538+
532539 public bool TryCreateProject ( ConsoleHelper console , string name , string id , string ? parentId = null )
533540 {
534541 parentId ??= "_Root" ;
0 commit comments