revision: add leak_pending flag
The new flag leak_pending in struct rev_info can be used to prevent prepare_revision_walk from freeing the list of pending objects. It will still forget about them, so it really is leaked. This behaviour may look weird at first, but it can be useful if the pointer to the list is saved before calling prepare_revision_walk. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
		 René Scharfe
					René Scharfe
				
			
				
					committed by
					
						 Junio C Hamano
						Junio C Hamano
					
				
			
			
				
	
			
			
			 Junio C Hamano
						Junio C Hamano
					
				
			
						parent
						
							468224e580
						
					
				
				
					commit
					4a43d374fc
				
			| @ -1974,6 +1974,7 @@ int prepare_revision_walk(struct rev_info *revs) | ||||
| 		} | ||||
| 		e++; | ||||
| 	} | ||||
| 	if (!revs->leak_pending) | ||||
| 		free(list); | ||||
|  | ||||
| 	if (revs->no_walk) | ||||
|  | ||||
| @ -97,6 +97,7 @@ struct rev_info { | ||||
| 			date_mode_explicit:1, | ||||
| 			preserve_subject:1; | ||||
| 	unsigned int	disable_stdin:1; | ||||
| 	unsigned int	leak_pending:1; | ||||
|  | ||||
| 	enum date_mode date_mode; | ||||
|  | ||||
|  | ||||
		Reference in New Issue
	
	Block a user