Esempio n. 1
0
        public override bool Equals(object obj)
        {
            ShallowCommit c = obj as ShallowCommit;

            if (c == null)
            {
                return(false);
            }

            return(this.Sha.Equals(c.Sha));
        }
Esempio n. 2
0
        /// <summary>
        /// Records the commits and branches from the repository
        /// </summary>
        private void RecordRepo(Repository repo, Config config)
        {
            ShallowCommit commonRoot = null;

            foreach (var branch in repo.Branches.Where(config.IsBranchIncluded).OrderBy(b => b.FriendlyName, new BranchComparer(config)))
            {
                List <ShallowCommit> commits = RecordBranch(repo, branch.FriendlyName, branch);
                if (commonRoot == null)
                {
                    commonRoot = commits.First();
                }
                if (commits.First() != commonRoot)
                {
                    throw new ZipperException("Cannot zip repositories with multiple roots: " + repo.Info.Path + " branch: " + branch.FriendlyName);
                }
            }
        }