@@ -23,10 +23,6 @@ static const char git_attr__unknown[] = "(builtin)unknown";
2323#define ATTR__UNSET NULL
2424#define ATTR__UNKNOWN git_attr__unknown
2525
26- #ifndef DEBUG_ATTR
27- #define DEBUG_ATTR 0
28- #endif
29-
3026struct git_attr {
3127 int attr_nr ; /* unique attribute number */
3228 char name [FLEX_ARRAY ]; /* attribute name */
@@ -807,33 +803,6 @@ static struct attr_stack *read_attr(struct index_state *istate,
807803 return res ;
808804}
809805
810- #if DEBUG_ATTR
811- static void debug_info (const char * what , struct attr_stack * elem )
812- {
813- fprintf (stderr , "%s: %s\n" , what , elem -> origin ? elem -> origin : "()" );
814- }
815- static void debug_set (const char * what , const char * match , struct git_attr * attr , const void * v )
816- {
817- const char * value = v ;
818-
819- if (ATTR_TRUE (value ))
820- value = "set" ;
821- else if (ATTR_FALSE (value ))
822- value = "unset" ;
823- else if (ATTR_UNSET (value ))
824- value = "unspecified" ;
825-
826- fprintf (stderr , "%s: %s => %s (%s)\n" ,
827- what , attr -> name , (char * ) value , match );
828- }
829- #define debug_push (a ) debug_info("push", (a))
830- #define debug_pop (a ) debug_info("pop", (a))
831- #else
832- #define debug_push (a ) do { ; } while (0)
833- #define debug_pop (a ) do { ; } while (0)
834- #define debug_set (a ,b ,c ,d ) do { ; } while (0)
835- #endif /* DEBUG_ATTR */
836-
837806static const char * git_etc_gitattributes (void )
838807{
839808 static const char * system_wide ;
@@ -954,7 +923,6 @@ static void prepare_attr_stack(struct index_state *istate,
954923 (!namelen || path [namelen ] == '/' ))
955924 break ;
956925
957- debug_pop (elem );
958926 * stack = elem -> prev ;
959927 attr_stack_free (elem );
960928 }
@@ -1028,7 +996,7 @@ static int path_matches(const char *pathname, int pathlen,
1028996
1029997static int macroexpand_one (struct all_attrs_item * all_attrs , int nr , int rem );
1030998
1031- static int fill_one (const char * what , struct all_attrs_item * all_attrs ,
999+ static int fill_one (struct all_attrs_item * all_attrs ,
10321000 const struct match_attr * a , int rem )
10331001{
10341002 int i ;
@@ -1039,9 +1007,6 @@ static int fill_one(const char *what, struct all_attrs_item *all_attrs,
10391007 const char * v = a -> state [i ].setto ;
10401008
10411009 if (* n == ATTR__UNKNOWN ) {
1042- debug_set (what ,
1043- a -> is_macro ? a -> u .attr -> name : a -> u .pat .pattern ,
1044- attr , v );
10451010 * n = v ;
10461011 rem -- ;
10471012 rem = macroexpand_one (all_attrs , attr -> attr_nr , rem );
@@ -1064,7 +1029,7 @@ static int fill(const char *path, int pathlen, int basename_offset,
10641029 continue ;
10651030 if (path_matches (path , pathlen , basename_offset ,
10661031 & a -> u .pat , base , stack -> originlen ))
1067- rem = fill_one ("fill" , all_attrs , a , rem );
1032+ rem = fill_one (all_attrs , a , rem );
10681033 }
10691034 }
10701035
@@ -1076,7 +1041,7 @@ static int macroexpand_one(struct all_attrs_item *all_attrs, int nr, int rem)
10761041 const struct all_attrs_item * item = & all_attrs [nr ];
10771042
10781043 if (item -> macro && item -> value == ATTR__TRUE )
1079- return fill_one ("expand" , all_attrs , item -> macro , rem );
1044+ return fill_one (all_attrs , item -> macro , rem );
10801045 else
10811046 return rem ;
10821047}
0 commit comments