Skip to content

Commit

Permalink
Strip out tfs-work-item-id string from TFS commits
Browse files Browse the repository at this point in the history
  • Loading branch information
sc68cal committed Feb 19, 2012
1 parent ad69066 commit 4efa6f6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions GitTfs/Commands/Rcheckin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public int Run()
return _writer.Write("HEAD", PerformRCheckin);
}

private void ProcessWorkItems(string commitMessage)
private String ProcessWorkItems(string commitMessage)
{
MatchCollection workitemMatches;
if ((workitemMatches = Sep.Git.Tfs.GitTfsConstants.TfsWorkItemRegex.Matches(commitMessage)).Count > 0)
Expand All @@ -64,7 +64,9 @@ private void ProcessWorkItems(string commitMessage)
break;
}
}
return Sep.Git.Tfs.GitTfsConstants.TfsWorkItemRegex.Replace(commitMessage, "");
}
return commitMessage;
}

private int PerformRCheckin(TfsChangesetInfo parentChangeset)
Expand Down Expand Up @@ -107,8 +109,7 @@ private int PerformRCheckin(TfsChangesetInfo parentChangeset)
string target = strs[0];
string[] gitParents = strs.AsEnumerable().Skip(1).Where(hash => hash != currentParent).ToArray();

string commitMessage = repo.GetCommitMessage(target, currentParent).Trim(' ', '\r', '\n');
ProcessWorkItems(commitMessage);
string commitMessage = ProcessWorkItems(repo.GetCommitMessage(target, currentParent).Trim(' ', '\r', '\n'));
_stdout.WriteLine("Starting checkin of {0} '{1}'", target.Substring(0, 8), commitMessage);
_checkinOptions.CheckinComment = commitMessage;
long newChangesetId = tfsRemote.Checkin(target, currentParent, parentChangeset);
Expand Down Expand Up @@ -140,8 +141,7 @@ private int PerformRCheckin(TfsChangesetInfo parentChangeset)
string target = strs[0];
string[] gitParents = strs.AsEnumerable().Skip(1).Where(hash => hash != tfsLatest).ToArray();

string commitMessage = repo.GetCommitMessage(target, tfsLatest).Trim(' ', '\r', '\n');
ProcessWorkItems(commitMessage);
string commitMessage = ProcessWorkItems(repo.GetCommitMessage(target, tfsLatest).Trim(' ', '\r', '\n'));
_stdout.WriteLine("Starting checkin of {0} '{1}'", target.Substring(0, 8), commitMessage);
_checkinOptions.CheckinComment = commitMessage;
long newChangesetId = tfsRemote.Checkin(target, parentChangeset);
Expand Down

0 comments on commit 4efa6f6

Please sign in to comment.