mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-25 22:17:51 +01:00
Add a silent option to MergePullRequest
This commit is contained in:
@@ -93,9 +93,10 @@ namespace TGS.Interface.Components
|
||||
/// </summary>
|
||||
/// <param name="PRnumber">The github pull request number in the remote repository</param>
|
||||
/// <param name="atSHA">The SHA of the pull request to merge</param>
|
||||
/// <param name="silent">Suppresses chat messages if <see langword="true"/></param>
|
||||
/// <returns><see langword="null"/> on success, error message on failure</returns>
|
||||
[OperationContract]
|
||||
string MergePullRequest(int PRnumber, string atSHA = null);
|
||||
string MergePullRequest(int PRnumber, string atSHA = null, bool silent = false);
|
||||
|
||||
/// <summary>
|
||||
/// Get the currently merged pull requests. Note that switching branches will delete this list and switching back won't restore it
|
||||
|
||||
@@ -889,7 +889,7 @@ namespace TGS.Server
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public string MergePullRequest(int PRNumber, string atSHA)
|
||||
public string MergePullRequest(int PRNumber, string atSHA, bool silent)
|
||||
{
|
||||
lock (RepoLock)
|
||||
{
|
||||
@@ -898,7 +898,8 @@ namespace TGS.Server
|
||||
var result = LoadRepo();
|
||||
if (result != null)
|
||||
return result;
|
||||
SendMessage(String.Format("REPO: Merging PR #{0}{1}...", PRNumber, atSHA != null ? String.Format(" at commit {0}", atSHA): ""), MessageType.DeveloperInfo);
|
||||
if(!silent)
|
||||
SendMessage(String.Format("REPO: Merging PR #{0}{1}...", PRNumber, atSHA != null ? String.Format(" at commit {0}", atSHA): ""), MessageType.DeveloperInfo);
|
||||
result = ResetNoLock(null);
|
||||
if (result != null)
|
||||
return result;
|
||||
@@ -928,7 +929,7 @@ namespace TGS.Server
|
||||
branch = Repo.Branches[LocalBranchName];
|
||||
if (branch == null)
|
||||
{
|
||||
SendMessage("REPO: PR could not be fetched. Does it exist?", MessageType.DeveloperInfo);
|
||||
SendMessage(String.Format("REPO: PR {0}could not be fetched. Does it exist?", silent ? String.Format("#{0} ", PRNumber) : ""), MessageType.DeveloperInfo);
|
||||
return String.Format("PR #{0} could not be fetched. Does it exist?", PRNumber);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user