aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--builtin-bundle.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin-bundle.c b/builtin-bundle.c
index ca3de60e4..55f6d0abc 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));