From a4b6411fcdefea708142462a2c2bef96538ed81d Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sun, 3 Jun 2018 10:33:27 +0200 Subject: [PATCH] Implement NullCommit --- Utils/Git/NullCommit.php | 27 +++++++++++++++++++++++++++ Utils/Git/Repository.php | 13 +++++-------- 2 files changed, 32 insertions(+), 8 deletions(-) create mode 100644 Utils/Git/NullCommit.php diff --git a/Utils/Git/NullCommit.php b/Utils/Git/NullCommit.php new file mode 100644 index 000000000..60a341b0b --- /dev/null +++ b/Utils/Git/NullCommit.php @@ -0,0 +1,27 @@ +setAuthor(new Author(trim($author[0] ?? ''), rtrim($author[1] ?? '', '>'))); @@ -914,8 +912,7 @@ class Repository $lines = $this->run('log -n ' . $limit); if (empty($lines)) { - // todo: return nullcommit - return new Commit(); + return new NullCommit(); } \preg_match('/[0-9ABCDEFabcdef]{40}/', $lines[0], $matches);