diff options
| author | Russell Belfer <rb@github.com> | 2014-01-28 11:47:33 -0800 |
|---|---|---|
| committer | Russell Belfer <rb@github.com> | 2014-01-30 09:59:59 -0800 |
| commit | 3cf11eef17d8359c032844de945da6e983572ecc (patch) | |
| tree | 1611080fb64f96a21e06f01f12b79aa34581cb20 /src/attr.c | |
| parent | c0644c3fbb31c381afb2d0658b5c6e83432fd8c9 (diff) | |
| download | libgit2-3cf11eef17d8359c032844de945da6e983572ecc.tar.gz | |
Misc cleanups
Diffstat (limited to 'src/attr.c')
| -rw-r--r-- | src/attr.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/attr.c b/src/attr.c index ff4446e2f..15ed5c9e0 100644 --- a/src/attr.c +++ b/src/attr.c @@ -49,6 +49,8 @@ int git_attr_get( git_attr_name attr; git_attr_rule *rule; + assert(value && repo && name); + *value = NULL; if (git_attr_path__init(&path, pathname, git_repository_workdir(repo)) < 0) @@ -103,6 +105,11 @@ int git_attr_get_many( attr_get_many_info *info = NULL; size_t num_found = 0; + if (!num_attr) + return 0; + + assert(values && repo && names); + if (git_attr_path__init(&path, pathname, git_repository_workdir(repo)) < 0) return -1; @@ -169,6 +176,8 @@ int git_attr_foreach( git_attr_assignment *assign; git_strmap *seen = NULL; + assert(repo && callback); + if (git_attr_path__init(&path, pathname, git_repository_workdir(repo)) < 0) return -1; |
