mirror of
				https://github.com/cuberite/polarssl.git
				synced 2025-10-30 19:20:40 -04:00 
			
		
		
		
	Add git rev-parse options
Signed-off-by: Xiaofei Bai <xiaofei.bai@arm.com>
This commit is contained in:
		
							parent
							
								
									184e8b6a36
								
							
						
					
					
						commit
						ccd738b853
					
				| @ -58,8 +58,8 @@ class CodeSizeComparison: | ||||
| 
 | ||||
|     @staticmethod | ||||
|     def validate_revision(revision): | ||||
|         result = subprocess.run(["git", "rev-parse", "--verify", revision], | ||||
|                                 check=False, stdout=subprocess.PIPE) | ||||
|         result = subprocess.check_output(["git", "rev-parse", "--verify", | ||||
|                                           revision + "^{commit}"], shell=False) | ||||
|         return result | ||||
| 
 | ||||
|     def _create_git_worktree(self, revision): | ||||
| @ -208,15 +208,11 @@ def main(): | ||||
|         parser.exit() | ||||
| 
 | ||||
|     validate_res = CodeSizeComparison.validate_revision(comp_args.old_rev) | ||||
|     if validate_res.returncode != 0: | ||||
|         sys.exit(validate_res.returncode) | ||||
|     old_revision = validate_res.stdout.decode().replace("\n", "") | ||||
|     old_revision = validate_res.decode().replace("\n", "") | ||||
| 
 | ||||
|     if comp_args.new_rev is not None: | ||||
|         validate_res = CodeSizeComparison.validate_revision(comp_args.new_rev) | ||||
|         if validate_res.returncode != 0: | ||||
|             sys.exit(validate_res.returncode) | ||||
|         new_revision = validate_res.stdout.decode().replace("\n", "") | ||||
|         new_revision = validate_res.decode().replace("\n", "") | ||||
|     else: | ||||
|         new_revision = "current" | ||||
| 
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Xiaofei Bai
						Xiaofei Bai