Ejemplo n.º 1
0
        /// <summary>Notifies that remote branch was created externally.</summary>
        /// <param name="remoteBranchData">Created remote branch data.</param>
        /// <returns>Created remote branch.</returns>
        internal RemoteBranch NotifyCreated(RemoteBranchData remoteBranchData)
        {
            var branch = ObjectFactories.CreateRemoteBranch(Repository, remoteBranchData);

            AddObject(branch);
            return(branch);
        }
Ejemplo n.º 2
0
        public static void UpdateRemoteBranch(RemoteBranch remoteBranch, RemoteBranchData branchData)
        {
            Verify.Argument.IsNotNull(remoteBranch, "remoteBranch");
            Verify.Argument.IsNotNull(branchData, "branchData");

            if (remoteBranch.Revision.Hash != branchData.SHA1)
            {
                remoteBranch.Pointer = remoteBranch.Repository.Revisions.GetOrCreateRevision(branchData.SHA1);
            }
        }
Ejemplo n.º 3
0
        public static RemoteBranch CreateRemoteBranch(Repository repository, RemoteBranchData branchData)
        {
            Verify.Argument.IsNotNull(repository, "repository");
            Verify.Argument.IsNotNull(branchData, "branchData");

            Revision revision;

            lock (repository.Revisions.SyncRoot)
            {
                revision = repository.Revisions.GetOrCreateRevision(branchData.SHA1);
            }
            return(new RemoteBranch(repository, branchData.Name, revision));
        }