diff options
| author | Vicent Martà <tanoku@gmail.com> | 2012-02-17 00:13:34 +0100 |
|---|---|---|
| committer | Vicent Martà <tanoku@gmail.com> | 2012-03-06 00:43:10 +0100 |
| commit | 1a48112342932e9fcd45a1ff5935f1c9c53b83d1 (patch) | |
| tree | fbb18cfe64e65025c6e1790972d1a106eea4cc54 /src/reflog.c | |
| parent | 45d387ac78bcf3167d69b736d0b322717bc492d4 (diff) | |
| download | libgit2-1a48112342932e9fcd45a1ff5935f1c9c53b83d1.tar.gz | |
error-handling: References
Yes, this is error handling solely for `refs.c`, but some of the
abstractions leak all ofer the code base.
Diffstat (limited to 'src/reflog.c')
| -rw-r--r-- | src/reflog.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/reflog.c b/src/reflog.c index 6ca9418cf..8f68a3ac7 100644 --- a/src/reflog.c +++ b/src/reflog.c @@ -246,12 +246,12 @@ int git_reflog_write(git_reference *ref, const git_oid *oid_old, if (error < GIT_SUCCESS) goto cleanup; - if (git_path_exists(log_path.ptr)) { + if (git_path_exists(log_path.ptr) == false) { error = git_futils_mkpath2file(log_path.ptr, GIT_REFLOG_DIR_MODE); if (error < GIT_SUCCESS) git__rethrow(error, "Failed to write reflog. Cannot create reflog directory"); - } else if (git_path_isfile(log_path.ptr)) { + } else if (git_path_isfile(log_path.ptr) == false) { error = git__throw(GIT_ERROR, "Failed to write reflog. `%s` is directory", log_path.ptr); } else if (oid_old == NULL) { @@ -302,7 +302,7 @@ int git_reflog_delete(git_reference *ref) error = git_buf_join_n(&path, '/', 3, ref->owner->path_repository, GIT_REFLOG_DIR, ref->name); - if (error == GIT_SUCCESS && git_path_exists(path.ptr) == 0) + if (error == GIT_SUCCESS && git_path_exists(path.ptr) == true) error = p_unlink(path.ptr); git_buf_free(&path); |
