diff --git a/SS14.MapServer/Services/GitService.cs b/SS14.MapServer/Services/GitService.cs index c16d099..b0ade65 100644 --- a/SS14.MapServer/Services/GitService.cs +++ b/SS14.MapServer/Services/GitService.cs @@ -38,13 +38,11 @@ public string Sync(string workingDirectory, string? gitRef = null, string? repoU if (!Path.IsPathRooted(repoDirectory)) repoDirectory = Path.Join(Directory.GetCurrentDirectory(), repoDirectory); - if (!Directory.Exists(repoDirectory)) Clone(repoUrl, repoDirectory, gitRef); Pull(repoDirectory, gitRef); - return repoDirectory; } @@ -96,6 +94,11 @@ private void Pull(string repoDirectory, string gitRef) _log.Debug("Opening repository in: {RepositoryPath}", repoDirectory); using var repository = new Repository(repoDirectory); + //Set a dummy identity + _log.Debug("Setting identity"); + repository.Config.Set("user.name", "ss14.mapserver"); + repository.Config.Set("user.email", "git@mapserver.localhost"); + _log.Debug("Fetching ref"); _buildService.Run(repoDirectory, "git", new List { "fetch origin", gitRef }).Wait(); @@ -103,7 +106,7 @@ private void Pull(string repoDirectory, string gitRef) Commands.Checkout(repository, StripRef(gitRef)); _log.Debug("Pulling latest changes"); - _buildService.Run(repoDirectory, "git", new List { "pull origin HEAD" }).Wait(); + _buildService.Run(repoDirectory, "git", new List { "pull origin HEAD --ff-only" }).Wait(); _log.Debug("Updating submodules"); foreach (var submodule in repository.Submodules)