diff options
-rw-r--r-- | builtin-bundle.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin-bundle.c b/builtin-bundle.c index ca3de60e44..55f6d0abcf 100644 --- a/builtin-bundle.c +++ b/builtin-bundle.c @@ -268,9 +268,9 @@ static int create_bundle(struct bundle_header *header, const char *path, struct rev_info revs; bundle_fd = (!strcmp(path, "-") ? 1 : - open(path, O_CREAT | O_WRONLY, 0666)); + open(path, O_CREAT | O_EXCL | O_WRONLY, 0666)); if (bundle_fd < 0) - return error("Could not write to '%s'", path); + return error("Could not create '%s': %s", path, strerror(errno)); /* write signature */ write_or_die(bundle_fd, bundle_signature, strlen(bundle_signature)); |