Merge pull request #324 from git-tfs/fix-rcheckin-ignores-no-build-default-comment
Fix: Rcheckin ignores --no-build-default-comment option
This commit is contained in:
@@ -96,7 +96,9 @@ namespace Sep.Git.Tfs.Commands
|
||||
string target = strs[0];
|
||||
string[] gitParents = strs.AsEnumerable().Skip(1).Where(hash => hash != currentParent).ToArray();
|
||||
|
||||
string commitMessage = repo.GetCommitMessage(target, currentParent).Trim(' ', '\r', '\n');
|
||||
string commitMessage = _checkinOptions.NoGenerateCheckinComment
|
||||
? repo.GetCommitMessage(target)
|
||||
: repo.GetCommitMessage(target, currentParent);
|
||||
var commitSpecificCheckinOptions = _checkinOptionsFactory.BuildCommitSpecificCheckinOptions(_checkinOptions, commitMessage);
|
||||
|
||||
_stdout.WriteLine("Starting checkin of {0} '{1}'", target.Substring(0, 8), commitSpecificCheckinOptions.CheckinComment);
|
||||
@@ -153,7 +155,9 @@ namespace Sep.Git.Tfs.Commands
|
||||
string target = strs[0];
|
||||
string[] gitParents = strs.AsEnumerable().Skip(1).Where(hash => hash != tfsLatest).ToArray();
|
||||
|
||||
string commitMessage = repo.GetCommitMessage(target, tfsLatest).Trim(' ', '\r', '\n');
|
||||
string commitMessage = _checkinOptions.NoGenerateCheckinComment
|
||||
? repo.GetCommitMessage(target)
|
||||
: repo.GetCommitMessage(target, tfsLatest);
|
||||
var commitSpecificCheckinOptions = _checkinOptionsFactory.BuildCommitSpecificCheckinOptions(_checkinOptions, commitMessage);
|
||||
_stdout.WriteLine("Starting checkin of {0} '{1}'", target.Substring(0, 8), commitSpecificCheckinOptions.CheckinComment);
|
||||
long newChangesetId = tfsRemote.Checkin(target, parentChangeset, commitSpecificCheckinOptions);
|
||||
|
||||
@@ -342,6 +342,11 @@ namespace Sep.Git.Tfs.Core
|
||||
return GitTfsConstants.TfsCommitInfoRegex.Replace(message.ToString(), "").Trim(' ', '\r', '\n');
|
||||
}
|
||||
|
||||
public string GetCommitMessage(string commitish)
|
||||
{
|
||||
return GetCommitMessage(commitish, commitish + "^");
|
||||
}
|
||||
|
||||
private static string NormalizeLineEndings(string input)
|
||||
{
|
||||
return string.IsNullOrEmpty(input)
|
||||
|
||||
@@ -29,6 +29,7 @@ namespace Sep.Git.Tfs.Core
|
||||
GitCommit GetCommit(string commitish);
|
||||
Dictionary<string, GitObject> GetObjects();
|
||||
string GetCommitMessage(string head, string parentCommitish);
|
||||
string GetCommitMessage(string commitish);
|
||||
string AssertValidBranchName(string gitBranchName);
|
||||
bool CreateBranch(string gitBranchName, string target);
|
||||
Branch RenameBranch(string oldName, string newName);
|
||||
|
||||
Reference in New Issue
Block a user