aboutsummaryrefslogtreecommitdiff
path: root/refs
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-10-03 15:42:49 +0900
committerJunio C Hamano <gitster@pobox.com>2017-10-03 15:42:49 +0900
commitcb1083ca23c2f78140b66b925ed0b82fe400eea5 (patch)
treec78509d2b9fbe79c99ed1acb83bf43886b4d0c0c /refs
parentd4e93836a6a072e392b20d7daf604fd41e15ecf9 (diff)
parent8a1a8d2ad1b41a0a28d37d1d21ee9620a23e91eb (diff)
downloadgit-cb1083ca23c2f78140b66b925ed0b82fe400eea5.tar.gz
git-cb1083ca23c2f78140b66b925ed0b82fe400eea5.tar.xz
Merge branch 'jk/read-in-full'
Code clean-up to prevent future mistakes by copying and pasting code that checks the result of read_in_full() function. * jk/read-in-full: worktree: check the result of read_in_full() worktree: use xsize_t to access file size distinguish error versus short read from read_in_full() avoid looking at errno for short read_in_full() returns prefer "!=" when checking read_in_full() result notes-merge: drop dead zero-write code files-backend: prefer "0" for write_in_full() error check
Diffstat (limited to 'refs')
-rw-r--r--refs/files-backend.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 38d16a13a..4b46cd2e2 100644
--- a/refs/files-backend.c
+++ b/refs/files-backend.c
@@ -3035,7 +3035,7 @@ static int files_reflog_expire(struct ref_store *ref_store,
} else if (update &&
(write_in_full(get_lock_file_fd(&lock->lk),
oid_to_hex(&cb.last_kept_oid), GIT_SHA1_HEXSZ) < 0 ||
- write_str_in_full(get_lock_file_fd(&lock->lk), "\n") < 1 ||
+ write_str_in_full(get_lock_file_fd(&lock->lk), "\n") < 0 ||
close_ref_gently(lock) < 0)) {
status |= error("couldn't write %s",
get_lock_file_path(&lock->lk));