summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-07-09 21:00:45 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-07-09 21:00:45 (GMT)
commitd341042f718ad39eef06ea8715f926eb17181115 (patch)
tree5015478518c40d753c7e20c828b422c5190360ec
parent3ed0f1e3a17b4fea15ad1e0b0d4c0eb50b23803a (diff)
parent35e6e212fdea3a22abe0dc5867b974b30b787be0 (diff)
downloadgit-d341042f718ad39eef06ea8715f926eb17181115.zip
git-d341042f718ad39eef06ea8715f926eb17181115.tar.gz
git-d341042f718ad39eef06ea8715f926eb17181115.tar.bz2
Merge branch 'mt/entry-fstat-fallback-fix' into master
"git checkout" failed to catch an error from fstat() after updating a path in the working tree. * mt/entry-fstat-fallback-fix: entry: check for fstat() errors after checkout
-rw-r--r--entry.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/entry.c b/entry.c
index 00b4903..449bd32 100644
--- a/entry.c
+++ b/entry.c
@@ -113,8 +113,7 @@ static int fstat_output(int fd, const struct checkout *state, struct stat *st)
/* use fstat() only when path == ce->name */
if (fstat_is_reliable() &&
state->refresh_cache && !state->base_dir_len) {
- fstat(fd, st);
- return 1;
+ return !fstat(fd, st);
}
return 0;
}