Commit 9893d376 by Edward Thomson

git_attr_cache_flush: return an int

Stop returning a void for functions, future-proofing them to allow them
to fail.
parent 4460bf40
...@@ -238,8 +238,11 @@ GIT_EXTERN(int) git_attr_foreach( ...@@ -238,8 +238,11 @@ GIT_EXTERN(int) git_attr_foreach(
* disk no longer match the cached contents of memory. This will cause * disk no longer match the cached contents of memory. This will cause
* the attributes files to be reloaded the next time that an attribute * the attributes files to be reloaded the next time that an attribute
* access function is called. * 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); git_repository *repo);
/** /**
......
...@@ -411,7 +411,7 @@ cancel: ...@@ -411,7 +411,7 @@ cancel:
return ret; return ret;
} }
void git_attr_cache_flush(git_repository *repo) int git_attr_cache_flush(git_repository *repo)
{ {
git_attr_cache *cache; git_attr_cache *cache;
...@@ -420,6 +420,8 @@ void git_attr_cache_flush(git_repository *repo) ...@@ -420,6 +420,8 @@ void git_attr_cache_flush(git_repository *repo)
*/ */
if (repo && (cache = git__swap(repo->attrcache, NULL)) != NULL) if (repo && (cache = git__swap(repo->attrcache, NULL)) != NULL)
attr_cache__free(cache); attr_cache__free(cache);
return 0;
} }
int git_attr_cache__insert_macro(git_repository *repo, git_attr_rule *macro) int git_attr_cache__insert_macro(git_repository *repo, git_attr_rule *macro)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment