From b491e5d932329557e687a0a6b1be6709567baeb3 Mon Sep 17 00:00:00 2001 From: Jakob Voss Date: Thu, 30 May 2024 12:04:18 +0200 Subject: [PATCH] Disable git error messages in log file (#179) --- classes/Utils/GitVersion.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/classes/Utils/GitVersion.php b/classes/Utils/GitVersion.php index 515777f..1ec8a1c 100644 --- a/classes/Utils/GitVersion.php +++ b/classes/Utils/GitVersion.php @@ -6,10 +6,10 @@ class GitVersion { private static function extractVersion() { return array_filter([ - "version" => trim(`git tag --points-at HEAD | head -1` ?? ""), - "branch" => trim(`git rev-parse --abbrev-ref HEAD` ?? ""), - "clean" => trim(`git diff --quiet && echo true` ?? ""), - "commit" => trim(`git rev-parse HEAD` ?? ""), + "version" => trim(`git tag --points-at HEAD 2>/dev/null | head -1` ?? ""), + "branch" => trim(`git rev-parse --abbrev-ref HEAD 2>/dev/null` ?? ""), + "clean" => trim(`git diff --quiet 2>/dev/null && echo true` ?? ""), + "commit" => trim(`git rev-parse HEAD 2>/dev/null` ?? ""), ]); }