diff options
author | Paul Holzinger <pholzing@redhat.com> | 2022-03-15 18:48:32 +0100 |
---|---|---|
committer | Matthew Heon <mheon@redhat.com> | 2022-03-30 14:03:45 -0400 |
commit | b7b8fedea9569076809557c99683bd0f0c79c7f0 (patch) | |
tree | ecc8c8d44e044306d51c20e603e3c422c564723d | |
parent | e424c64b471b79f67c4a0cf2deb9e7e64289fcab (diff) | |
download | podman-b7b8fedea9569076809557c99683bd0f0c79c7f0.tar.gz podman-b7b8fedea9569076809557c99683bd0f0c79c7f0.tar.bz2 podman-b7b8fedea9569076809557c99683bd0f0c79c7f0.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>
-rw-r--r-- | cmd/podman/system/version.go | 8 |
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}} |