Skip to content

Commit 659c4b4

Browse files
Fix file does not exist issue
1 parent 9b00257 commit 659c4b4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Hook/Message/Action/PrepareFromFile.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,12 @@ public function execute(Config $config, IO $io, Repository $repository, Config\A
5656
throw new ActionFailed('PrepareFromFile requires \'file\' option');
5757
}
5858

59+
if (!is_file($cacheFile)) {
60+
return;
61+
}
62+
5963
// if there is a commit message don't do anything just delete the file
6064
if ($repository->getCommitMsg()->isEmpty()) {
61-
if (!is_file($cacheFile)) {
62-
return;
63-
}
6465
$msg = (string)file_get_contents($cacheFile);
6566
$repository->setCommitMsg(
6667
new CommitMessage($msg, $repository->getCommitMsg()->getCommentCharacter())

0 commit comments

Comments
 (0)