예제 #1
0
        internal async Task RemoveBranchAsync(RemoteRepositoryBranch branch, IProgress <OperationProgress> progress, CancellationToken cancellationToken)
        {
            Verify.Argument.IsNotNull(branch, nameof(branch));
            Verify.Argument.IsFalse(branch.IsDeleted, nameof(branch),
                                    Resources.ExcSuppliedObjectIsDeleted.UseAsFormat("branch"));

            var parameters = GetRemoveRemoteReferenceParameters(branch);
            await Remote.Repository.Accessor
            .RemoveRemoteReferences
            .InvokeAsync(parameters, progress, cancellationToken);

            _remoteTags.Remove(branch.Name);
            branch.MarkAsDeleted();
            InvokeBranchDeleted(branch);
            //return Remote.Repository.Accessor
            //	.RemoveRemoteReferences.InvokeAsync(parameters, progress, cancellationToken)
            //	.ContinueWith(
            //	t =>
            //	{
            //		TaskUtility.PropagateFaultedStates(t);
            //		_remoteTags.Remove(branch.Name);
            //		branch.MarkAsDeleted();
            //		InvokeBranchDeleted(branch);
            //	},
            //	cancellationToken,
            //	TaskContinuationOptions.ExecuteSynchronously,
            //	TaskScheduler.Default);
        }
예제 #2
0
        internal void RemoveBranch(RemoteRepositoryBranch branch)
        {
            Verify.Argument.IsNotNull(branch, nameof(branch));
            Verify.Argument.IsFalse(branch.IsDeleted, nameof(branch),
                                    Resources.ExcSuppliedObjectIsDeleted.UseAsFormat("branch"));

            var parameters = GetRemoveRemoteReferenceParameters(branch);

            Remote.Repository.Accessor.RemoveRemoteReferences.Invoke(parameters);

            _remoteBranches.Remove(branch.Name);
            branch.MarkAsDeleted();
            InvokeBranchDeleted(branch);
        }
예제 #3
0
        internal Task RemoveBranchAsync(RemoteRepositoryBranch branch, IProgress<OperationProgress> progress, CancellationToken cancellationToken)
        {
            Verify.Argument.IsNotNull(branch, "branch");
            Verify.Argument.IsFalse(branch.IsDeleted, "branch",
                Resources.ExcSuppliedObjectIsDeleted.UseAsFormat("branch"));

            var parameters = GetRemoveRemoteReferenceParameters(branch);
            return _remote.Repository.Accessor
                .RemoveRemoteReferences.InvokeAsync(parameters, progress, cancellationToken)
                .ContinueWith(
                t =>
                {
                    TaskUtility.PropagateFaultedStates(t);
                    _remoteTags.Remove(branch.Name);
                    branch.MarkAsDeleted();
                    InvokeBranchDeleted(branch);
                },
                cancellationToken,
                TaskContinuationOptions.ExecuteSynchronously,
                TaskScheduler.Default);
        }
예제 #4
0
        internal void RemoveBranch(RemoteRepositoryBranch branch)
        {
            Verify.Argument.IsNotNull(branch, "branch");
            Verify.Argument.IsFalse(branch.IsDeleted, "branch",
                Resources.ExcSuppliedObjectIsDeleted.UseAsFormat("branch"));

            var parameters = GetRemoveRemoteReferenceParameters(branch);
            _remote.Repository.Accessor.RemoveRemoteReferences.Invoke(parameters);

            _remoteBranches.Remove(branch.Name);
            branch.MarkAsDeleted();
            InvokeBranchDeleted(branch);
        }