From 2b32b6f78c24c4e0f85b18818013feddd75c5bde Mon Sep 17 00:00:00 2001 From: "Helmut K. C. Tessarek" Date: Tue, 4 Jul 2023 18:08:52 -0400 Subject: [PATCH] fix version when compiled at a specific commit When a specific commit is checked out from the main branch, the vaultwarden version is reported as `vaultwarden x.y.z-githash (HEAD)`. This is a problem, because the admin interface reports this as a version from a branch called HEAD, while in reality the commit was from the main branch. --- build.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.rs b/build.rs index 1b171fb4..e9593265 100644 --- a/build.rs +++ b/build.rs @@ -72,7 +72,7 @@ fn version_from_git_info() -> Result { // Combined version if let Some(exact) = exact_tag { Ok(exact) - } else if &branch != "main" && &branch != "master" { + } else if &branch != "main" && &branch != "master" && &branch != "HEAD" { Ok(format!("{last_tag}-{rev_short} ({branch})")) } else { Ok(format!("{last_tag}-{rev_short}"))