summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 64fdc08)
raw | patch | inline | side by side (parent: 64fdc08)
author | Csaba Henk <csaba@gluster.com> | |
Fri, 27 Aug 2010 20:31:47 +0000 (20:31 +0000) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 27 Aug 2010 23:46:26 +0000 (16:46 -0700) |
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>
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>
bundle.c | patch | blob | history | |
t/t5704-bundle.sh | patch | blob | history |
diff --git a/bundle.c b/bundle.c
index ff97adcb891caf98dcc655e71e29eaec5dae0135..65ea26bdb8c2cef671030c3a62d87d84612e8144 100644 (file)
--- a/bundle.c
+++ b/bundle.c
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;
}
diff --git a/t/t5704-bundle.sh b/t/t5704-bundle.sh
index ddc3dc52f497d05e20cf4034d544df6d08632935..728ccd88c3d69f06bff2c3593ddc325f9186402c 100755 (executable)
--- a/t/t5704-bundle.sh
+++ b/t/t5704-bundle.sh
'
+test_expect_success 'die if bundle file cannot be created' '
+
+ mkdir adir &&
+ test_must_fail git bundle create adir --all
+
+'
+
test_expect_failure 'bundle --stdin' '
echo master | git bundle create stdin-bundle.bdl --stdin &&