X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=entry.c;h=cc841edf9051460b3a382ea25c0097f245ec8884;hb=456cb4cf3ef6e3dec637b7061b0c834b62eba0f5;hp=5daacc2fe51eada819bedea05f958fbf87f5b889;hpb=8130949bdc9c36f527148205b86a2ffe551cac53;p=git.git diff --git a/entry.c b/entry.c index 5daacc2fe..cc841edf9 100644 --- a/entry.c +++ b/entry.c @@ -35,7 +35,7 @@ static void create_directories(const char *path, int path_len, */ if (mkdir(buf, 0777)) { if (errno == EEXIST && state->force && - !unlink(buf) && !mkdir(buf, 0777)) + !unlink_or_warn(buf) && !mkdir(buf, 0777)) continue; die("cannot create directory at %s", buf); } @@ -147,7 +147,8 @@ static int write_entry(struct cache_entry *ce, char *path, const struct checkout wrote = write_in_full(fd, new, size); /* use fstat() only when path == ce->name */ - if (state->refresh_cache && !to_tempfile && !state->base_dir_len) { + if (fstat_is_reliable() && + state->refresh_cache && !to_tempfile && !state->base_dir_len) { fstat(fd, &st); fstat_done = 1; }