Add an extension method overload.
This commit is contained in:
@@ -47,7 +47,7 @@ namespace Sep.Git.Tfs.Commands
|
||||
else
|
||||
{
|
||||
_stdout.WriteLine("TFS Changeset #" + newChangesetId + " was created. Marking it as a merge commit...");
|
||||
parentChangeset.Remote.FetchWithMerge(newChangesetId, false, null, refToCheckin);
|
||||
parentChangeset.Remote.FetchWithMerge(newChangesetId, false, refToCheckin);
|
||||
|
||||
if (refToCheckin == "HEAD")
|
||||
parentChangeset.Remote.Repository.Merge(parentChangeset.Remote.MaxCommitHash);
|
||||
|
||||
@@ -142,7 +142,7 @@ namespace Sep.Git.Tfs.Commands
|
||||
try
|
||||
{
|
||||
newChangesetId = tfsRemote.Checkin(target, currentParent, parentChangeset, commitSpecificCheckinOptions, tfsRepositoryPathOfMergedBranch);
|
||||
var fetchResult = tfsRemote.FetchWithMerge(newChangesetId, false, null, rc.Parents);
|
||||
var fetchResult = tfsRemote.FetchWithMerge(newChangesetId, false, rc.Parents);
|
||||
if (fetchResult.NewChangesetCount != 1)
|
||||
{
|
||||
var lastCommit = _globals.Repository.FindCommitHashByChangesetId(newChangesetId);
|
||||
@@ -210,7 +210,7 @@ namespace Sep.Git.Tfs.Commands
|
||||
|
||||
_stdout.WriteLine("Starting checkin of {0} '{1}'", target.Substring(0, 8), commitSpecificCheckinOptions.CheckinComment);
|
||||
long newChangesetId = tfsRemote.Checkin(rc.Sha, parentChangeset, commitSpecificCheckinOptions, tfsRepositoryPathOfMergedBranch);
|
||||
tfsRemote.FetchWithMerge(newChangesetId, false, null, rc.Parents);
|
||||
tfsRemote.FetchWithMerge(newChangesetId, false, rc.Parents);
|
||||
if (tfsRemote.MaxChangesetId != newChangesetId)
|
||||
throw new GitTfsException("error: New TFS changesets were found. Rcheckin was not finished.");
|
||||
|
||||
|
||||
@@ -73,4 +73,12 @@ namespace Sep.Git.Tfs.Core
|
||||
void EnsureTfsAuthenticated();
|
||||
bool MatchesUrlAndRepositoryPath(string tfsUrl, string tfsRepositoryPath);
|
||||
}
|
||||
|
||||
public static class IGitTfsRemoteExt
|
||||
{
|
||||
public static IFetchResult FetchWithMerge(this IGitTfsRemote remote, long mergeChangesetId, bool stopOnFailMergeCommit = false, params string[] parentCommitsHashes)
|
||||
{
|
||||
return remote.FetchWithMerge(mergeChangesetId, stopOnFailMergeCommit, null, parentCommitsHashes);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user