Exemplo n.º 1
0
        public ITask <List <GitLock> > ListLocks(bool local, BaseOutputListProcessor <GitLock> processor = null)
        {
            Logger.Trace("ListLocks");

            return(new GitListLocksTask(new GitObjectFactory(environment), local, cancellationToken, processor)
                   .Configure(processManager));
        }
Exemplo n.º 2
0
 public GitLogTask(IGitObjectFactory gitObjectFactory,
                   CancellationToken token, BaseOutputListProcessor <GitLogEntry> processor = null)
     : base(token, processor ?? new LogEntryOutputProcessor(gitObjectFactory))
 {
     Name      = TaskName;
     arguments = baseArguments;
 }
Exemplo n.º 3
0
        public ITask <List <GitLogEntry> > Log(BaseOutputListProcessor <GitLogEntry> processor = null)
        {
            Logger.Trace("Log");

            return(new GitLogTask(new GitObjectFactory(environment), cancellationToken, processor)
                   .Configure(processManager));
        }
Exemplo n.º 4
0
 ///<inheritdoc/>
 public ITask <List <GitLogEntry> > Log(BaseOutputListProcessor <GitLogEntry> processor = null)
 {
     return(new GitLogTask(new GitObjectFactory(environment), cancellationToken, processor)
            .Configure(processManager)
            .Catch(exception => exception is ProcessException &&
                   exception.Message.StartsWith("fatal: your current branch") &&
                   exception.Message.EndsWith("does not have any commits yet"))
            .Then((success, list) => success ? list : new List <GitLogEntry>()));
 }
Exemplo n.º 5
0
 public GitListLocksTask(IGitObjectFactory gitObjectFactory, bool local,
                         CancellationToken token, BaseOutputListProcessor <GitLock> processor = null)
     : base(token, processor ?? new LockOutputProcessor(gitObjectFactory))
 {
     args = "lfs locks";
     if (local)
     {
         args += " --local";
     }
 }
Exemplo n.º 6
0
 public GitListLocksTask(bool local,
                         CancellationToken token, BaseOutputListProcessor <GitLock> processor = null)
     : base(token, processor ?? new LocksOutputProcessor())
 {
     Name = TaskName;
     args = "locks --json";
     if (local)
     {
         args += " --local";
     }
 }
Exemplo n.º 7
0
        public GitConfigGetAllTask(string key, GitConfigSource configSource,
                                   CancellationToken token, BaseOutputListProcessor <string> processor = null, ITask dependsOn = null)
            : base(token, processor ?? new SimpleListOutputProcessor(), dependsOn)
        {
            var source = "";

            source +=
                configSource == GitConfigSource.NonSpecified ? "--get-all" :
                configSource == GitConfigSource.Local ? "--get --local" :
                configSource == GitConfigSource.User ? "--get --global" :
                "--get --system";
            arguments = String.Format("config {0} {1}", source, key);
        }
Exemplo n.º 8
0
        public GitConfigGetAllTask(string key, GitConfigSource configSource,
                                   CancellationToken token, BaseOutputListProcessor <string> processor = null)
            : base(token, processor ?? new SimpleListOutputProcessor())
        {
            Guard.ArgumentNotNullOrWhiteSpace(key, nameof(key));
            Name = TaskName;
            var source = "";

            source +=
                configSource == GitConfigSource.NonSpecified ? "--get-all" :
                configSource == GitConfigSource.Local ? "--get --local" :
                configSource == GitConfigSource.User ? "--get --global" :
                "--get --system";
            arguments = String.Format("config {0} {1}", source, key);
        }
Exemplo n.º 9
0
        public GitConfigListTask(GitConfigSource configSource, CancellationToken token, BaseOutputListProcessor <KeyValuePair <string, string> > processor = null)
            : base(token, processor ?? new ConfigOutputProcessor())
        {
            Name = TaskName;
            var source = "";

            if (configSource != GitConfigSource.NonSpecified)
            {
                source  = "--";
                source += configSource == GitConfigSource.Local
                    ? "local"
                    : (configSource == GitConfigSource.User
                        ? "system"
                        : "global");
            }
            arguments = String.Format("config {0} -l", source);
        }
Exemplo n.º 10
0
 ///<inheritdoc/>
 public ITask <List <GitLock> > ListLocks(bool local, BaseOutputListProcessor <GitLock> processor = null)
 {
     return(new GitListLocksTask(local, cancellationToken, processor)
            .Configure(processManager, environment.GitLfsExecutablePath));
 }
Exemplo n.º 11
0
 public GitListLocalBranchesTask(CancellationToken token, BaseOutputListProcessor <GitBranch> processor = null)
     : base(token, processor ?? new BranchListOutputProcessor())
 {
     Name = TaskName;
 }
Exemplo n.º 12
0
 public GitRemoteListTask(CancellationToken token, BaseOutputListProcessor <GitRemote> processor = null)
     : base(token, processor ?? new RemoteListOutputProcessor())
 {
 }
Exemplo n.º 13
0
 public ITask <List <GitLock> > ListLocks(bool local, BaseOutputListProcessor <GitLock> processor = null)
 {
     return(new GitListLocksTask(local, cancellationToken, processor)
            .Configure(processManager));
 }