diff options
author | nulltoken <emeric.fermas@gmail.com> | 2010-12-05 20:18:56 +0100 |
---|---|---|
committer | nulltoken <emeric.fermas@gmail.com> | 2010-12-05 20:18:56 +0100 |
commit | 6f02c3bad8f563036b9d2035e656bcb847d4c292 (patch) | |
tree | bd0e705257b18beb5016876a719940de1e431bbd /src/blob.c | |
parent | d3e2dd5ea174cb14905a5ab48e3b97bcf9f0b97e (diff) | |
download | libgit2-6f02c3bad8f563036b9d2035e656bcb847d4c292.tar.gz |
Small source code readability improvements.
Replaced magic number "0" with GIT_SUCCESS constant wherever it made sense.
Diffstat (limited to 'src/blob.c')
-rw-r--r-- | src/blob.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/blob.c b/src/blob.c index c301ae15d..65e1dd947 100644 --- a/src/blob.c +++ b/src/blob.c @@ -40,7 +40,7 @@ const char *git_blob_rawcontent(git_blob *blob) if (blob->object.in_memory) return NULL; - if (!blob->object.source.open && git_object__source_open((git_object *)blob) < 0) + if (!blob->object.source.open && git_object__source_open((git_object *)blob) < GIT_SUCCESS) return NULL; return blob->object.source.raw.data; @@ -119,13 +119,13 @@ int git_blob_writefile(git_oid *written_id, git_repository *repo, const char *pa if (gitfo_exists(path) < 0) return GIT_ENOTFOUND; - if ((error = git_blob_new(&blob, repo)) < 0) + if ((error = git_blob_new(&blob, repo)) < GIT_SUCCESS) return error; - if ((error = git_blob_set_rawcontent_fromfile(blob, path)) < 0) + if ((error = git_blob_set_rawcontent_fromfile(blob, path)) < GIT_SUCCESS) return error; - if ((error = git_object_write((git_object *)blob)) < 0) + if ((error = git_object_write((git_object *)blob)) < GIT_SUCCESS) return error; git_oid_cpy(written_id, git_object_id((git_object *)blob)); |