public void CanQueryRebaseOperation() { SelfCleaningDirectory scd = BuildSelfCleaningDirectory(); var path = Repository.Init(scd.DirectoryPath); using (Repository repo = new Repository(path)) { ConstructRebaseTestRepository(repo); Commands.Checkout(repo, topicBranch1Name); Assert.False(repo.RetrieveStatus().IsDirty); Branch branch = repo.Branches[topicBranch1Name]; Branch upstream = repo.Branches[conflictBranch1Name]; Branch onto = repo.Branches[conflictBranch1Name]; RebaseResult rebaseResult = repo.Rebase.Start(branch, upstream, onto, Constants.Identity, null); // Verify that we have a conflict. Assert.Equal(RebaseStatus.Conflicts, rebaseResult.Status); Assert.True(repo.RetrieveStatus().IsDirty); Assert.False(repo.Index.IsFullyMerged); Assert.Equal(0, rebaseResult.CompletedStepCount); Assert.Equal(3, rebaseResult.TotalStepCount); RebaseStepInfo info = repo.Rebase.GetCurrentStepInfo(); Assert.Equal(0, repo.Rebase.GetCurrentStepIndex()); Assert.Equal(3, repo.Rebase.GetTotalStepCount()); Assert.Equal(RebaseStepOperation.Pick, info.Type); } }
internal AfterRebaseStepInfo(RebaseStepInfo stepInfo, Commit commit, long completedStepIndex, long totalStepCount) { StepInfo = stepInfo; Commit = commit; WasPatchAlreadyApplied = false; CompletedStepIndex = completedStepIndex; TotalStepCount = totalStepCount; }
/// <summary> /// Constructor to call when the patch has already been applied for this step. /// </summary> /// <param name="stepInfo"></param> /// <param name="completedStepIndex"/> /// <param name="totalStepCount"></param> internal AfterRebaseStepInfo(RebaseStepInfo stepInfo, long completedStepIndex, long totalStepCount) : this(stepInfo, null, completedStepIndex, totalStepCount) { WasPatchAlreadyApplied = true; }