* an insanely large number of attributes.
*/
-#define NO_THE_INDEX_COMPATIBILITY_MACROS
#include "cache.h"
#include "config.h"
#include "exec-cmd.h"
struct attr_hashmap {
struct hashmap map;
-#ifndef NO_PTHREADS
pthread_mutex_t mutex;
-#endif
};
static inline void hashmap_lock(struct attr_hashmap *map)
{
-#ifndef NO_PTHREADS
pthread_mutex_lock(&map->mutex);
-#endif
}
static inline void hashmap_unlock(struct attr_hashmap *map)
{
-#ifndef NO_PTHREADS
pthread_mutex_unlock(&map->mutex);
-#endif
}
/*
if (strlen(ATTRIBUTE_MACRO_PREFIX) < namelen &&
starts_with(name, ATTRIBUTE_MACRO_PREFIX)) {
if (!macro_ok) {
- fprintf(stderr, "%s not allowed: %s:%d\n",
- name, src, lineno);
+ fprintf_ln(stderr, _("%s not allowed: %s:%d"),
+ name, src, lineno);
goto fail_return;
}
is_macro = 1;
* Like info/exclude and .gitignore, the attribute information can
* come from many places.
*
- * (1) .gitattribute file of the same directory;
- * (2) .gitattribute file of the parent directory if (1) does not have
+ * (1) .gitattributes file of the same directory;
+ * (2) .gitattributes file of the parent directory if (1) does not have
* any match; this goes recursively upwards, just like .gitignore.
* (3) $GIT_DIR/info/attributes, which overrides both of the above.
*
* In the same file, later entries override the earlier match, so in the
* global list, we would have entries from info/attributes the earliest
- * (reading the file from top to bottom), .gitattribute of the root
+ * (reading the file from top to bottom), .gitattributes of the root
* directory (again, reading the file from top to bottom) down to the
* current directory, and then scan the list backwards to find the first match.
* This is exactly the same as what is_excluded() does in dir.c to deal with
size_t nr;
size_t alloc;
struct attr_check **checks;
-#ifndef NO_PTHREADS
pthread_mutex_t mutex;
-#endif
} check_vector;
static inline void vector_lock(void)
{
-#ifndef NO_PTHREADS
pthread_mutex_lock(&check_vector.mutex);
-#endif
}
static inline void vector_unlock(void)
{
-#ifndef NO_PTHREADS
pthread_mutex_unlock(&check_vector.mutex);
-#endif
}
static void check_vector_add(struct attr_check *c)
* set of attribute definitions, followed by the contents
* of $(prefix)/etc/gitattributes and a file specified by
* core.attributesfile. Then, contents from
- * .gitattribute files from directories closer to the
+ * .gitattributes files from directories closer to the
* root to the ones in deeper directories are pushed
* to the stack. Finally, at the very top of the stack
* we always keep the contents of $GIT_DIR/info/attributes.
void attr_start(void)
{
-#ifndef NO_PTHREADS
pthread_mutex_init(&g_attr_hashmap.mutex, NULL);
pthread_mutex_init(&check_vector.mutex, NULL);
-#endif
}