1. Stefan Saasen
  2. git

Commits

Junio C Hamano  committed d42cb58 Merge

Merge branch 'ch/maint-cannot-create-bundle-error'

* ch/maint-cannot-create-bundle-error:
bundle: detect if bundle file cannot be created

  • Participants
  • Parent commits 9f0ccb5, 0f5cdf6
  • Branches master

Comments (0)

Files changed (2)

File bundle.c

View file
  • Ignore whitespace
 	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;
 }
 

File t/t5704-bundle.sh

View file
  • Ignore whitespace
 
 '
 
+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 &&