@@ -488,48 +488,49 @@ static int git_attr_config(const char *var, const char *value, void *dummy)
488
488
489
489
static void bootstrap_attr_stack (void )
490
490
{
491
- if (!attr_stack ) {
492
- struct attr_stack * elem ;
491
+ struct attr_stack * elem ;
493
492
494
- elem = read_attr_from_array (builtin_attr );
495
- elem -> origin = NULL ;
496
- elem -> prev = attr_stack ;
497
- attr_stack = elem ;
493
+ if (attr_stack )
494
+ return ;
498
495
499
- if (git_attr_system ()) {
500
- elem = read_attr_from_file (git_etc_gitattributes (), 1 );
501
- if (elem ) {
502
- elem -> origin = NULL ;
503
- elem -> prev = attr_stack ;
504
- attr_stack = elem ;
505
- }
506
- }
496
+ elem = read_attr_from_array (builtin_attr );
497
+ elem -> origin = NULL ;
498
+ elem -> prev = attr_stack ;
499
+ attr_stack = elem ;
507
500
508
- git_config (git_attr_config , NULL );
509
- if (attributes_file ) {
510
- elem = read_attr_from_file (attributes_file , 1 );
511
- if (elem ) {
512
- elem -> origin = NULL ;
513
- elem -> prev = attr_stack ;
514
- attr_stack = elem ;
515
- }
501
+ if (git_attr_system ()) {
502
+ elem = read_attr_from_file (git_etc_gitattributes (), 1 );
503
+ if (elem ) {
504
+ elem -> origin = NULL ;
505
+ elem -> prev = attr_stack ;
506
+ attr_stack = elem ;
516
507
}
508
+ }
517
509
518
- if (!is_bare_repository () || direction == GIT_ATTR_INDEX ) {
519
- elem = read_attr (GITATTRIBUTES_FILE , 1 );
520
- elem -> origin = strdup ("" );
510
+ git_config (git_attr_config , NULL );
511
+ if (attributes_file ) {
512
+ elem = read_attr_from_file (attributes_file , 1 );
513
+ if (elem ) {
514
+ elem -> origin = NULL ;
521
515
elem -> prev = attr_stack ;
522
516
attr_stack = elem ;
523
- debug_push (elem );
524
517
}
518
+ }
525
519
526
- elem = read_attr_from_file (git_path (INFOATTRIBUTES_FILE ), 1 );
527
- if (!elem )
528
- elem = xcalloc (1 , sizeof (* elem ));
529
- elem -> origin = NULL ;
520
+ if (!is_bare_repository () || direction == GIT_ATTR_INDEX ) {
521
+ elem = read_attr (GITATTRIBUTES_FILE , 1 );
522
+ elem -> origin = strdup ("" );
530
523
elem -> prev = attr_stack ;
531
524
attr_stack = elem ;
525
+ debug_push (elem );
532
526
}
527
+
528
+ elem = read_attr_from_file (git_path (INFOATTRIBUTES_FILE ), 1 );
529
+ if (!elem )
530
+ elem = xcalloc (1 , sizeof (* elem ));
531
+ elem -> origin = NULL ;
532
+ elem -> prev = attr_stack ;
533
+ attr_stack = elem ;
533
534
}
534
535
535
536
static void prepare_attr_stack (const char * path , int dirlen )
0 commit comments