bundle: detect if bundle file cannot be created
bundle command silently died with no sign of failure if it could not create the bundle file. (Eg.: its path resovles to a directory, or the parent dir is sticky while file already exists and is owned by someone else.) Signed-off-by: Csaba Henk <csaba@gluster.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
64fdc08dac
commit
0f5cdf653b
6
bundle.c
6
bundle.c
@ -372,8 +372,10 @@ int create_bundle(struct bundle_header *header, const char *path,
|
||||
close(rls.in);
|
||||
if (finish_command(&rls))
|
||||
return error ("pack-objects died");
|
||||
if (!bundle_to_stdout)
|
||||
commit_lock_file(&lock);
|
||||
if (!bundle_to_stdout) {
|
||||
if (commit_lock_file(&lock))
|
||||
die_errno("cannot create '%s'", path);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user