From 96312be367576f8431f7cd644de8c36ee54d60cb Mon Sep 17 00:00:00 2001 From: Jordan Brown Date: Mon, 12 Jun 2017 06:03:25 -0400 Subject: [PATCH] Fixes attempted commits with no changes (#43) * Fixes attempted commits with no changes * Spaces --- TGServerService/Repository.cs | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/TGServerService/Repository.cs b/TGServerService/Repository.cs index 3ae0eba32c..3eb5e596cc 100644 --- a/TGServerService/Repository.cs +++ b/TGServerService/Repository.cs @@ -18,8 +18,8 @@ namespace TGServerService const string RepoData = RepoPath + "/data"; const string RepoErrorUpToDate = "Already up to date!"; const string SSHPushRemote = "ssh_push_target"; - const string PrivateKeyPath = "RepoKey/private_key.txt"; - const string PublicKeyPath = "RepoKey/public_key.txt"; + const string PrivateKeyPath = "RepoKey/private_key.txt"; + const string PublicKeyPath = "RepoKey/public_key.txt"; const string PRJobFile = "prtestjob.json"; const string CommitMessage = "Automatic changelog compile, [ci skip]"; @@ -656,6 +656,9 @@ namespace TGServerService Commands.Stage(Repo, "html/changelog.html"); Commands.Stage(Repo, "html/changelogs"); + if (Repo.RetrieveStatus().Added.Count() == 0) //nothing to commit + return null; + // Create the committer's signature and commit var authorandcommitter = MakeSig(); @@ -712,12 +715,12 @@ namespace TGServerService { Username = user, }; - return new SshUserKeyCredentials() - { - Username = user, - PrivateKey = PrivateKeyPath, - PublicKey = PublicKeyPath, - Passphrase = "", + return new SshUserKeyCredentials() + { + Username = user, + PrivateKey = PrivateKeyPath, + PublicKey = PublicKeyPath, + Passphrase = "", }; }