summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--refs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/refs.c b/refs.c
index 8e24060d80..aa79c93045 100644
--- a/refs.c
+++ b/refs.c
@@ -2357,7 +2357,7 @@ int for_each_reflog_ent_reverse(const char *refname, each_reflog_ent_fn fn, void
return error("cannot seek back reflog for %s: %s",
refname, strerror(errno));
nread = fread(buf, cnt, 1, logfp);
- if (nread < 0)
+ if (nread != 1)
return error("cannot read %d bytes from reflog for %s: %s",
cnt, refname, strerror(errno));
pos -= cnt;