mirror of
				https://github.com/actions/checkout.git
				synced 2025-10-31 10:08:37 +08:00 
			
		
		
		
	.
This commit is contained in:
		
							parent
							
								
									1571d4fa58
								
							
						
					
					
						commit
						e5d5317cf2
					
				
							
								
								
									
										12
									
								
								dist/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										12
									
								
								dist/index.js
									
									
									
									
										vendored
									
									
								
							|  | @ -4799,9 +4799,11 @@ class GitCommandManager { | |||
|     branchList(remote) { | ||||
|         return __awaiter(this, void 0, void 0, function* () { | ||||
|             const result = []; | ||||
|             // Note, this implementation uses "rev-parse --symbolic" because the output from
 | ||||
|             // Note, this implementation uses "rev-parse --symbolic-full-name" because the output from
 | ||||
|             // "branch --list" is more difficult when in a detached HEAD state.
 | ||||
|             const args = ['rev-parse', '--symbolic']; | ||||
|             // Note, this implementation uses "rev-parse --symbolic-full-name" because there is a bug
 | ||||
|             // in Git 2.18 that causes "rev-parse --symbolic" to output symbolic full names.
 | ||||
|             const args = ['rev-parse', '--symbolic-full-name']; | ||||
|             if (remote) { | ||||
|                 args.push('--remotes=origin'); | ||||
|             } | ||||
|  | @ -4812,6 +4814,12 @@ class GitCommandManager { | |||
|             for (let branch of output.stdout.trim().split('\n')) { | ||||
|                 branch = branch.trim(); | ||||
|                 if (branch) { | ||||
|                     if (branch.startsWith('refs/heads/')) { | ||||
|                         branch = branch.substr('refs/heads/'.length); | ||||
|                     } | ||||
|                     else if (branch.startsWith('refs/remotes/')) { | ||||
|                         branch = branch.substr('refs/remotes/'.length); | ||||
|                     } | ||||
|                     result.push(branch); | ||||
|                 } | ||||
|             } | ||||
|  |  | |||
|  | @ -77,10 +77,12 @@ class GitCommandManager { | |||
|   async branchList(remote: boolean): Promise<string[]> { | ||||
|     const result: string[] = [] | ||||
| 
 | ||||
|     // Note, this implementation uses "rev-parse --symbolic" because the output from
 | ||||
|     // Note, this implementation uses "rev-parse --symbolic-full-name" because the output from
 | ||||
|     // "branch --list" is more difficult when in a detached HEAD state.
 | ||||
|     // Note, this implementation uses "rev-parse --symbolic-full-name" because there is a bug
 | ||||
|     // in Git 2.18 that causes "rev-parse --symbolic" to output symbolic full names.
 | ||||
| 
 | ||||
|     const args = ['rev-parse', '--symbolic'] | ||||
|     const args = ['rev-parse', '--symbolic-full-name'] | ||||
|     if (remote) { | ||||
|       args.push('--remotes=origin') | ||||
|     } else { | ||||
|  | @ -92,6 +94,12 @@ class GitCommandManager { | |||
|     for (let branch of output.stdout.trim().split('\n')) { | ||||
|       branch = branch.trim() | ||||
|       if (branch) { | ||||
|         if (branch.startsWith('refs/heads/')) { | ||||
|           branch = branch.substr('refs/heads/'.length) | ||||
|         } else if (branch.startsWith('refs/remotes/')) { | ||||
|           branch = branch.substr('refs/remotes/'.length) | ||||
|         } | ||||
| 
 | ||||
|         result.push(branch) | ||||
|       } | ||||
|     } | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user