]> asedeno.scripts.mit.edu Git - git.git/commitdiff
Merge branch 'ch/maint-cannot-create-bundle-error'
authorJunio C Hamano <gitster@pobox.com>
Wed, 15 Sep 2010 19:39:22 +0000 (12:39 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 15 Sep 2010 19:39:22 +0000 (12:39 -0700)
* ch/maint-cannot-create-bundle-error:
  bundle: detect if bundle file cannot be created

bundle.c
t/t5704-bundle.sh

index ff97adcb891caf98dcc655e71e29eaec5dae0135..65ea26bdb8c2cef671030c3a62d87d84612e8144 100644 (file)
--- a/bundle.c
+++ b/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;
 }
 
index ddc3dc52f497d05e20cf4034d544df6d08632935..728ccd88c3d69f06bff2c3593ddc325f9186402c 100755 (executable)
@@ -30,6 +30,13 @@ test_expect_success 'tags can be excluded by rev-list options' '
 
 '
 
+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 &&