summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2020-01-18 15:41:20 +0000
committerEdward Thomson <ethomson@edwardthomson.com>2020-01-24 15:12:56 -0600
commit9893d376eea1624870a844ef6644c837062b1751 (patch)
tree1a445664738e67bbbd3d8bc3e6cc2858038fad4f
parent4460bf40c9e935acb853b5d61279a50014ede0b3 (diff)
downloadlibgit2-9893d376eea1624870a844ef6644c837062b1751.tar.gz
git_attr_cache_flush: return an int
Stop returning a void for functions, future-proofing them to allow them to fail.
-rw-r--r--include/git2/attr.h5
-rw-r--r--src/attrcache.c4
2 files changed, 7 insertions, 2 deletions
diff --git a/include/git2/attr.h b/include/git2/attr.h
index 72e43806c..a3ab5a7a2 100644
--- a/include/git2/attr.h
+++ b/include/git2/attr.h
@@ -238,8 +238,11 @@ GIT_EXTERN(int) git_attr_foreach(
* disk no longer match the cached contents of memory. This will cause
* the attributes files to be reloaded the next time that an attribute
* access function is called.
+ *
+ * @param repo The repository containing the gitattributes cache
+ * @return 0 on success, or an error code
*/
-GIT_EXTERN(void) git_attr_cache_flush(
+GIT_EXTERN(int) git_attr_cache_flush(
git_repository *repo);
/**
diff --git a/src/attrcache.c b/src/attrcache.c
index 21a1fea24..f02dd9d1d 100644
--- a/src/attrcache.c
+++ b/src/attrcache.c
@@ -411,7 +411,7 @@ cancel:
return ret;
}
-void git_attr_cache_flush(git_repository *repo)
+int git_attr_cache_flush(git_repository *repo)
{
git_attr_cache *cache;
@@ -420,6 +420,8 @@ void git_attr_cache_flush(git_repository *repo)
*/
if (repo && (cache = git__swap(repo->attrcache, NULL)) != NULL)
attr_cache__free(cache);
+
+ return 0;
}
int git_attr_cache__insert_macro(git_repository *repo, git_attr_rule *macro)