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

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