Disallow invalid --pretty= abbreviations
--pretty=o is a valid abbreviation, --pretty=omfg is not Noticed by: Nicolas Vilz Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
		
				
					committed by
					
						
						Junio C Hamano
					
				
			
			
				
	
			
			
			
						parent
						
							aacd404e77
						
					
				
				
					commit
					b6936205e7
				
			
							
								
								
									
										3
									
								
								commit.c
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								commit.c
									
									
									
									
									
								
							@ -47,7 +47,8 @@ enum cmit_fmt get_commit_format(const char *arg)
 | 
				
			|||||||
	if (*arg == '=')
 | 
						if (*arg == '=')
 | 
				
			||||||
		arg++;
 | 
							arg++;
 | 
				
			||||||
	for (i = 0; i < ARRAY_SIZE(cmt_fmts); i++) {
 | 
						for (i = 0; i < ARRAY_SIZE(cmt_fmts); i++) {
 | 
				
			||||||
		if (!strncmp(arg, cmt_fmts[i].n, cmt_fmts[i].cmp_len))
 | 
							if (!strncmp(arg, cmt_fmts[i].n, cmt_fmts[i].cmp_len) &&
 | 
				
			||||||
 | 
							    !strncmp(arg, cmt_fmts[i].n, strlen(arg)))
 | 
				
			||||||
			return cmt_fmts[i].v;
 | 
								return cmt_fmts[i].v;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user