Better cat-file tree format
This commit is contained in:
		| @@ -286,6 +286,10 @@ def cmd_cat_file(args): | ||||
|  | ||||
| def cat_file(repo, obj, fmt=None): | ||||
|     obj = object_read(repo, object_find(repo, obj, fmt=fmt)) | ||||
|     if fmt == b'tree': | ||||
|         for item in obj.items: | ||||
|             print(f"{item.mode.decode('ascii')} {item.path} {item.sha}") | ||||
|     else: | ||||
|         sys.stdout.buffer.write(obj.serialize()) | ||||
|  | ||||
| def object_find(repo, name, fmt=None, follow=True): | ||||
|   | ||||
							
								
								
									
										1
									
								
								test
									
									
									
									
									
								
							
							
								
								
								
								
								
							
						
						
									
										1
									
								
								test
									
									
									
									
									
								
							 Submodule test deleted from d53851a324
									
								
							
		Reference in New Issue
	
	Block a user