Ejemplo n.º 1
0
 internal void StartCommitChanges(GitJobParameters p)
 {
     Thread th = new Thread(new ParameterizedThreadStart(CommitChanges));
     th.Start(p);
 }
Ejemplo n.º 2
0
        private void Execute(JobList jobq)
        {
            List<string> tochange = new List<string>();
            List<string> toadd = new List<string>();
            List<string> toremove = new List<string>();
            GitJobParameters p = new GitJobParameters();

            p.tochange = tochange;
            p.toadd = toadd;
            p.toremove = toremove;
            p.gitpath = this.path;

            Job j;

            if (jobq[0].Action == ActionType.Added
                || jobq[0].Action == ActionType.Changed
                || jobq[0].Action == ActionType.Removed)
            {
                // git add/rm are packed into a series and git commit/push are executed after executing the git add/rm Jobs.
                while(jobq.Count > 0)
                {
                    j = jobq[0];
                    jobq.RemoveAt(0);
                    switch (j.Action)
                    {
                        case ActionType.Changed:
                            p.tochange.Add(j.FullPath);
                            break;
                        case ActionType.Added:
                            p.toadd.Add(j.FullPath);
                            break;
                        case ActionType.Removed:
                            p.toremove.Add(j.FullPath);
                            break;
                    }
                }

                this.git.StartCommitChanges(p);
            }
            else
            {
                // git status/clone/push is executed alone.

                p.tarpath = jobq[0].FullPath;
                this.git.StartGitActions(p, jobq[0].Action);
            }
        }
Ejemplo n.º 3
0
        internal void StartGitActions(GitJobParameters p, ActionType action)
        {
            Thread th = null;
            switch (action)
            {
                case ActionType.Clone:
                    th = new Thread(new ParameterizedThreadStart(CloneFromRemote));
                    break;
                case ActionType.Pull:
                    th = new Thread(new ParameterizedThreadStart(PullFromRemote));
                    break;
                case ActionType.Status:
                    th = new Thread(new ParameterizedThreadStart(StatusAndRefresh));
                    break;
            }

            th.Start(p);
        }