From 672a9fed61693c6ed4e3ae32e29eb65bddcc85d8 Mon Sep 17 00:00:00 2001 From: Brandon Ording Date: Sat, 1 May 2021 13:57:26 -0400 Subject: [PATCH 1/2] Use .git directory for mutex name --- src/GitVersion.App/GitVersionExecutor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GitVersion.App/GitVersionExecutor.cs b/src/GitVersion.App/GitVersionExecutor.cs index 0f10152c13..8a75afe1f9 100644 --- a/src/GitVersion.App/GitVersionExecutor.cs +++ b/src/GitVersion.App/GitVersionExecutor.cs @@ -57,7 +57,7 @@ public int Execute(GitVersionOptions gitVersionOptions) private int RunGitVersionTool(GitVersionOptions gitVersionOptions) { - var mutexName = gitVersionOptions.WorkingDirectory.Replace(Path.DirectorySeparatorChar.ToString(), ""); + var mutexName = repositoryInfo.DotGitDirectory.Replace(Path.DirectorySeparatorChar.ToString(), ""); using var mutex = new Mutex(true, $@"Global\{mutexName}", out var acquired); try From 17683266414157e532e4a02ffb7cc81fe614a125 Mon Sep 17 00:00:00 2001 From: Brandon Ording Date: Sat, 1 May 2021 17:53:12 -0400 Subject: [PATCH 2/2] Add gitversion prefix to mutex name --- src/GitVersion.App/GitVersionExecutor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GitVersion.App/GitVersionExecutor.cs b/src/GitVersion.App/GitVersionExecutor.cs index 8a75afe1f9..2ae0f84cd4 100644 --- a/src/GitVersion.App/GitVersionExecutor.cs +++ b/src/GitVersion.App/GitVersionExecutor.cs @@ -58,7 +58,7 @@ public int Execute(GitVersionOptions gitVersionOptions) private int RunGitVersionTool(GitVersionOptions gitVersionOptions) { var mutexName = repositoryInfo.DotGitDirectory.Replace(Path.DirectorySeparatorChar.ToString(), ""); - using var mutex = new Mutex(true, $@"Global\{mutexName}", out var acquired); + using var mutex = new Mutex(true, $@"Global\gitversion{mutexName}", out var acquired); try {