-
-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Edge case: Empty message in the first commit (#217)
* Edge case: Empty message in the first commit (#217) Don't try to consume a 2nd new line when the first repository commit has an empty message. * Ensure author identity
- Loading branch information
1 parent
5a47e03
commit 0853cb9
Showing
2 changed files
with
18 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -76,4 +76,19 @@ public function testIterable($repository) | |
} | ||
} | ||
} | ||
|
||
public function testFirstMessageEmpty() | ||
{ | ||
$repository = $this->createEmptyRepository(false); | ||
$repository->run('config', ['--local', 'user.name', '"Unit Test"']); | ||
$repository->run('config', ['--local', 'user.email', '"[email protected]"']); | ||
|
||
// Edge case: first commit lacks a message. | ||
file_put_contents($repository->getWorkingDir().'/file', 'foo'); | ||
$repository->run('add', ['.']); | ||
$repository->run('commit', ['--allow-empty-message', '--no-edit']); | ||
|
||
$commits = $repository->getLog()->getCommits(); | ||
$this->assertCount(1, $commits); | ||
} | ||
} |