Skip to content

Commit

Permalink
Merge branch 'mt/entry-fstat-fallback-fix' into master
Browse files Browse the repository at this point in the history
"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
  • Loading branch information
gitster committed Jul 9, 2020
2 parents 3ed0f1e + 35e6e21 commit d341042
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions entry.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit d341042

Please sign in to comment.