X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=entry.c;h=410b758aab7efc6d777f0344500f97b1cbc52946;hb=ffd97f3a35d8394773409f17d58156b32ca911cf;hp=b8426dbd0dae619b9f2023f9cf46f4d8c3df0a24;hpb=c1067050ce58b5b39f528fe634732da858664603;p=git.git diff --git a/entry.c b/entry.c index b8426dbd..410b758a 100644 --- a/entry.c +++ b/entry.c @@ -60,7 +60,7 @@ static void remove_subtree(const char *path) static int create_file(const char *path, unsigned int mode) { mode = (mode & 0100) ? 0777 : 0666; - return open(path, O_WRONLY | O_TRUNC | O_CREAT | O_EXCL, mode); + return open(path, O_WRONLY | O_CREAT | O_EXCL, mode); } static int write_entry(struct cache_entry *ce, const char *path, struct checkout *state) @@ -132,7 +132,7 @@ int checkout_entry(struct cache_entry *ce, struct checkout *state) if (!state->force) { if (!state->quiet) fprintf(stderr, "git-checkout-index: %s already exists\n", path); - return 0; + return -1; } /*