archive.c: replace `git_config()` with `git_config_get_bool()` family
Use `git_config_get_bool()` family instead of `git_config()` to take advantage of the config-set API which provides a cleaner control flow. Signed-off-by: Tanay Abhra <tanayabh@gmail.com> Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>maint
							parent
							
								
									b27a572099
								
							
						
					
					
						commit
						95790ff60d
					
				
							
								
								
									
										12
									
								
								archive.c
								
								
								
								
							
							
						
						
									
										12
									
								
								archive.c
								
								
								
								
							|  | @ -402,14 +402,6 @@ static int parse_archive_args(int argc, const char **argv, | |||
| 	return argc; | ||||
| } | ||||
|  | ||||
| static int git_default_archive_config(const char *var, const char *value, | ||||
| 				      void *cb) | ||||
| { | ||||
| 	if (!strcmp(var, "uploadarchive.allowunreachable")) | ||||
| 		remote_allow_unreachable = git_config_bool(var, value); | ||||
| 	return git_default_config(var, value, cb); | ||||
| } | ||||
|  | ||||
| int write_archive(int argc, const char **argv, const char *prefix, | ||||
| 		  int setup_prefix, const char *name_hint, int remote) | ||||
| { | ||||
|  | @ -420,7 +412,9 @@ int write_archive(int argc, const char **argv, const char *prefix, | |||
| 	if (setup_prefix && prefix == NULL) | ||||
| 		prefix = setup_git_directory_gently(&nongit); | ||||
|  | ||||
| 	git_config(git_default_archive_config, NULL); | ||||
| 	git_config_get_bool("uploadarchive.allowunreachable", &remote_allow_unreachable); | ||||
| 	git_config(git_default_config, NULL); | ||||
|  | ||||
| 	init_tar_archiver(); | ||||
| 	init_zip_archiver(); | ||||
|  | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	 Tanay Abhra
						Tanay Abhra