diff options
author | yuangli <yuangli@mathworks.com> | 2022-07-29 15:04:17 +0100 |
---|---|---|
committer | yuangli <yuangli@mathworks.com> | 2022-07-29 15:04:17 +0100 |
commit | 598ec303c6862f581c22c49228d543442e30257a (patch) | |
tree | bee246cfd37ecde10b6329a9d1c7b6be3675f351 /src/libgit2/repository.c | |
parent | 73d25f0e7b026d7b744e249d922f248376bcce5d (diff) | |
download | libgit2-598ec303c6862f581c22c49228d543442e30257a.tar.gz |
eliminate build warnings
Diffstat (limited to 'src/libgit2/repository.c')
-rw-r--r-- | src/libgit2/repository.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/libgit2/repository.c b/src/libgit2/repository.c index d9bc537fe..bc2aba324 100644 --- a/src/libgit2/repository.c +++ b/src/libgit2/repository.c @@ -3341,12 +3341,20 @@ int git_repository_state_cleanup(git_repository *repo) } int git_repository__shallow_roots(git_array_oid_t *out, git_repository *repo) { - int error =0; - if (!repo->shallow_grafts) - load_grafts(repo); + int error = 0; + + if (!repo->shallow_grafts && (error = load_grafts(repo)) < 0) + return error; + + if ((error = git_grafts_refresh(repo->shallow_grafts)) < 0) { + return error; + } - git_grafts_refresh(repo->shallow_grafts); - return git_grafts_get_oids(out, repo->shallow_grafts); + if ((error = git_grafts_get_oids(out, repo->shallow_grafts)) < 0) { + return error; + } + + return 0; } int git_repository__shallow_roots_write(git_repository *repo, git_array_oid_t roots) |