summaryrefslogtreecommitdiff
path: root/cmd/podman
diff options
context:
space:
mode:
authorPaul Holzinger <pholzing@redhat.com>2022-03-15 18:48:32 +0100
committerPaul Holzinger <pholzing@redhat.com>2022-03-15 20:44:19 +0100
commit45df70ec1e92e6f23ad7f7ef5214ea2181f7bcb1 (patch)
tree0261608fc087d07e074574bcc88e62c298fe4807 /cmd/podman
parentfa0d3c564a0868e79d46d0bfbfea40a98456f2b4 (diff)
downloadpodman-45df70ec1e92e6f23ad7f7ef5214ea2181f7bcb1.tar.gz
podman-45df70ec1e92e6f23ad7f7ef5214ea2181f7bcb1.tar.bz2
podman-45df70ec1e92e6f23ad7f7ef5214ea2181f7bcb1.zip
fix empty newline in version output
When podman is build without git commit information it will print a empty newline instead. This is undesirable and a regression introduced in commit 7d22cc88ef38. To test build podman with `go build -mod=vendor -o bin/podman ./cmd/podman` and check the output of bin/podman version with and without this commit. [NO NEW TESTS NEEDED] Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Diffstat (limited to 'cmd/podman')
-rw-r--r--cmd/podman/system/version.go8
1 files changed, 2 insertions, 6 deletions
diff --git a/cmd/podman/system/version.go b/cmd/podman/system/version.go
index 6239482b5..9fb4a966a 100644
--- a/cmd/podman/system/version.go
+++ b/cmd/podman/system/version.go
@@ -89,9 +89,7 @@ Client:\tPodman Engine
Version:\t{{.Version}}
API Version:\t{{.APIVersion}}
Go Version:\t{{.GoVersion}}
-{{if .GitCommit -}}
- Git Commit:\t{{.GitCommit}}
-{{- end}}
+{{if .GitCommit -}}Git Commit:\t{{.GitCommit}}\n{{end -}}
Built:\t{{.BuiltTime}}
OS/Arch:\t{{.OsArch}}
{{- end}}
@@ -102,9 +100,7 @@ Server:\tPodman Engine
Version:\t{{.Version}}
API Version:\t{{.APIVersion}}
Go Version:\t{{.GoVersion}}
-{{if .GitCommit -}}
- Git Commit:\t{{.GitCommit}}
-{{- end}}
+{{if .GitCommit -}}Git Commit:\t{{.GitCommit}}\n{{end -}}
Built:\t{{.BuiltTime}}
OS/Arch:\t{{.OsArch}}
{{- end}}{{- end}}