Пример #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));
        }
Пример #2
0
 public GitLogTask(IGitObjectFactory gitObjectFactory,
                   CancellationToken token, BaseOutputListProcessor <GitLogEntry> processor = null)
     : base(token, processor ?? new LogEntryOutputProcessor(gitObjectFactory))
 {
     Name      = TaskName;
     arguments = baseArguments;
 }
Пример #3
0
        public ITask <List <GitLogEntry> > Log(BaseOutputListProcessor <GitLogEntry> processor = null)
        {
            Logger.Trace("Log");

            return(new GitLogTask(new GitObjectFactory(environment), cancellationToken, processor)
                   .Configure(processManager));
        }
Пример #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>()));
 }
Пример #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";
     }
 }
Пример #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";
     }
 }
Пример #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);
        }
Пример #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);
        }
Пример #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);
        }
Пример #10
0
 ///<inheritdoc/>
 public ITask <List <GitLock> > ListLocks(bool local, BaseOutputListProcessor <GitLock> processor = null)
 {
     return(new GitListLocksTask(local, cancellationToken, processor)
            .Configure(processManager, environment.GitLfsExecutablePath));
 }
Пример #11
0
 public GitListLocalBranchesTask(CancellationToken token, BaseOutputListProcessor <GitBranch> processor = null)
     : base(token, processor ?? new BranchListOutputProcessor())
 {
     Name = TaskName;
 }
Пример #12
0
 public GitRemoteListTask(CancellationToken token, BaseOutputListProcessor <GitRemote> processor = null)
     : base(token, processor ?? new RemoteListOutputProcessor())
 {
 }
Пример #13
0
 public ITask <List <GitLock> > ListLocks(bool local, BaseOutputListProcessor <GitLock> processor = null)
 {
     return(new GitListLocksTask(local, cancellationToken, processor)
            .Configure(processManager));
 }