vendor/libgit2/src/attrcache.c in rugged-0.27.10.1 vs vendor/libgit2/src/attrcache.c in rugged-0.28.0
- old
+ new
@@ -16,11 +16,11 @@
GIT_INLINE(int) attr_cache_lock(git_attr_cache *cache)
{
GIT_UNUSED(cache); /* avoid warning if threading is off */
if (git_mutex_lock(&cache->lock) < 0) {
- giterr_set(GITERR_OS, "unable to get attr cache lock");
+ git_error_set(GIT_ERROR_OS, "unable to get attr cache lock");
return -1;
}
return 0;
}
@@ -31,11 +31,11 @@
}
GIT_INLINE(git_attr_file_entry *) attr_cache_lookup_entry(
git_attr_cache *cache, const char *path)
{
- khiter_t pos = git_strmap_lookup_index(cache->files, path);
+ size_t pos = git_strmap_lookup_index(cache->files, path);
if (git_strmap_valid_index(cache->files, pos))
return git_strmap_value_at(cache->files, pos);
else
return NULL;
@@ -58,11 +58,11 @@
if (baselen && base[baselen - 1] != '/')
cachesize++;
}
ce = git_pool_mallocz(pool, (uint32_t)cachesize);
- GITERR_CHECK_ALLOC(ce);
+ GIT_ERROR_CHECK_ALLOC(ce);
if (baselen) {
memcpy(ce->fullpath, base, baselen);
if (base[baselen - 1] != '/')
@@ -202,11 +202,11 @@
cleanup:
*out_file = file;
*out_entry = entry;
- git_buf_free(&path);
+ git_buf_dispose(&path);
return error;
}
int git_attr_cache__get(
git_attr_file **out,
@@ -248,11 +248,11 @@
git_attr_file__free(file); /* offset incref from lookup */
file = NULL;
}
/* no error if file simply doesn't exist */
if (error == GIT_ENOTFOUND) {
- giterr_clear();
+ git_error_clear();
error = 0;
}
}
*out = file;
@@ -264,11 +264,11 @@
git_attr_file_source source,
const char *filename)
{
git_attr_cache *cache = git_repository_attr_cache(repo);
git_strmap *files;
- khiter_t pos;
+ size_t pos;
git_attr_file_entry *entry;
if (!cache || !(files = cache->files))
return false;
@@ -308,11 +308,11 @@
else if (!git_sysdir_find_xdg_file(&buf, fallback)) {
*out = git_buf_detach(&buf);
}
git_config_entry_free(entry);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return error;
}
static void attr_cache__free(git_attr_cache *cache)
@@ -372,15 +372,15 @@
if (cache)
return 0;
cache = git__calloc(1, sizeof(git_attr_cache));
- GITERR_CHECK_ALLOC(cache);
+ GIT_ERROR_CHECK_ALLOC(cache);
/* set up lock */
if (git_mutex_init(&cache->lock) < 0) {
- giterr_set(GITERR_OS, "unable to initialize lock for attr cache");
+ git_error_set(GIT_ERROR_OS, "unable to initialize lock for attr cache");
git__free(cache);
return -1;
}
if ((ret = git_repository_config_snapshot(&cfg, repo)) < 0)
@@ -441,11 +441,11 @@
/* TODO: generate warning log if (macro->assigns.length == 0) */
if (macro->assigns.length == 0)
return 0;
if (attr_cache_lock(cache) < 0) {
- giterr_set(GITERR_OS, "unable to get attr cache lock");
+ git_error_set(GIT_ERROR_OS, "unable to get attr cache lock");
error = -1;
} else {
git_strmap_insert(macros, macro->match.pattern, macro, &error);
git_mutex_unlock(&cache->lock);
}
@@ -455,10 +455,10 @@
git_attr_rule *git_attr_cache__lookup_macro(
git_repository *repo, const char *name)
{
git_strmap *macros = git_repository_attr_cache(repo)->macros;
- khiter_t pos;
+ size_t pos;
pos = git_strmap_lookup_index(macros, name);
if (!git_strmap_valid_index(macros, pos))
return NULL;