From 80c8019f8840d9cebd839a8bd54e812c91a1f713 Mon Sep 17 00:00:00 2001 From: Daniel Cazzulino Date: Sat, 11 Feb 2023 02:04:03 +0000 Subject: [PATCH] Fix missing first character of local branch name The replacement string seems to be considered a regex because it's replacing more than it matches as a string only. So replace it with multiple replacements instead. --- src/ThisAssembly.Git/ThisAssembly.Git.targets | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ThisAssembly.Git/ThisAssembly.Git.targets b/src/ThisAssembly.Git/ThisAssembly.Git.targets index 0329c82a..a3da21bd 100644 --- a/src/ThisAssembly.Git/ThisAssembly.Git.targets +++ b/src/ThisAssembly.Git/ThisAssembly.Git.targets @@ -62,7 +62,8 @@ $(RepositoryRoot).git/HEAD - $([System.IO.File]::ReadAllText($(RepositoryHead)).TrimStart("ref: refs/heads/")) + $([System.IO.File]::ReadAllText($(RepositoryHead)).Trim()) + $(RepositoryBranch.TrimStart("ref:").Trim().TrimStart("refs").Trim("/").TrimStart("heads").Trim("/").Trim())