public async Task <bool> CanMakeBranchFor(PackageUpdateSet packageUpdateSet,
                                                  ForkData pushFork)
        {
            try
            {
                var branchName   = BranchNamer.MakeSinglePackageName(packageUpdateSet);
                var branchExists = await _collaborationFactory.CollaborationPlatform.RepositoryBranchExists(pushFork.Owner, pushFork.Name, branchName);

                return(!branchExists);
            }
            catch (Exception ex)
            {
                _logger.Error($"Failed on existing branch check at {pushFork.Owner}/{pushFork.Name}", ex);
                return(false);
            }
        }
示例#2
0
        public async Task <bool> CanMakeBranchFor(PackageUpdateSet packageUpdateSet,
                                                  ForkData pushFork, string branchNamePrefix = null)
        {
            try
            {
                var branchName   = BranchNamer.MakeSinglePackageName(packageUpdateSet, branchNamePrefix);
                var branchExists = await _collaborationFactory.CollaborationPlatform.RepositoryBranchExists(pushFork.Owner, pushFork.Name, branchName);

                return(!branchExists);
            }
#pragma warning disable CA1031
            catch (Exception ex)
#pragma warning restore CA1031
            {
                _logger.Error($"Failed on existing branch check at {pushFork.Owner}/{pushFork.Name}", ex);
                return(false);
            }
        }