@@ -177,7 +177,7 @@ int git_reference_name_to_id(
177177 return 0 ;
178178}
179179
180- static int reference__normalize_for_repo (
180+ static int reference_normalize_for_repo (
181181 git_refname_t out ,
182182 git_repository * repo ,
183183 const char * name ,
@@ -190,29 +190,12 @@ static int reference__normalize_for_repo(
190190 precompose )
191191 flags |= GIT_REF_FORMAT__PRECOMPOSE_UNICODE ;
192192
193- if (!validate ) {
194- flags |= GIT_REF_VALIDATION_DISABLE ;
195- }
193+ if (!validate )
194+ flags |= GIT_REF_FORMAT__VALIDATION_DISABLE ;
196195
197196 return git_reference_normalize_name (out , GIT_REFNAME_MAX , name , flags );
198197}
199198
200- static int reference_normalize_for_repo (
201- git_refname_t out ,
202- git_repository * repo ,
203- const char * name )
204- {
205- return reference__normalize_for_repo (out , repo , name , true);
206- }
207-
208- static int reference_normalize_for_repo_without_validation (
209- git_refname_t out ,
210- git_repository * repo ,
211- const char * name )
212- {
213- return reference__normalize_for_repo (out , repo , name , false);
214- }
215-
216199int git_reference_lookup_resolved (
217200 git_reference * * ref_out ,
218201 git_repository * repo ,
@@ -236,7 +219,7 @@ int git_reference_lookup_resolved(
236219
237220 scan_type = GIT_REF_SYMBOLIC ;
238221
239- if ((error = reference_normalize_for_repo (scan_name , repo , name )) < 0 )
222+ if ((error = reference_normalize_for_repo (scan_name , repo , name , true )) < 0 )
240223 return error ;
241224
242225 if ((error = git_repository_refdb__weakptr (& refdb , repo )) < 0 )
@@ -406,7 +389,7 @@ static int reference__create(
406389 if (ref_out )
407390 * ref_out = NULL ;
408391
409- error = reference_normalize_for_repo (normalized , repo , name );
392+ error = reference_normalize_for_repo (normalized , repo , name , true );
410393 if (error < 0 )
411394 return error ;
412395
@@ -427,11 +410,8 @@ static int reference__create(
427410 } else {
428411 git_refname_t normalized_target ;
429412
430- if (git_reference__enable_symbolic_ref_target_validation ) {
431- error = reference_normalize_for_repo (normalized_target , repo , symbolic );
432- } else {
433- error = reference_normalize_for_repo_without_validation (normalized_target , repo , symbolic );
434- }
413+ error = reference_normalize_for_repo (normalized_target , repo ,
414+ symbolic , git_reference__enable_symbolic_ref_target_validation );
435415
436416 if (error < 0 )
437417 return error ;
@@ -612,7 +592,7 @@ static int reference__rename(git_reference **out, git_reference *ref, const char
612592 assert (ref && new_name && signature );
613593
614594 if ((error = reference_normalize_for_repo (
615- normalized , git_reference_owner (ref ), new_name )) < 0 )
595+ normalized , git_reference_owner (ref ), new_name , true )) < 0 )
616596 return error ;
617597
618598
@@ -905,7 +885,7 @@ int git_reference__normalize_name(
905885 int segment_len , segments_count = 0 , error = GIT_EINVALIDSPEC ;
906886 unsigned int process_flags ;
907887 bool normalize = (buf != NULL );
908- bool validate = (flags & GIT_REF_VALIDATION_DISABLE ) == 0 ;
888+ bool validate = (flags & GIT_REF_FORMAT__VALIDATION_DISABLE ) == 0 ;
909889
910890#ifdef GIT_USE_ICONV
911891 git_path_iconv_t ic = GIT_PATH_ICONV_INIT ;
0 commit comments