Exemple #1
0
        public void StashDiffToolAgainstHEAD(string stashName, string fileName)
        {
            string cmd = GitCommandCreator.StashDiffToolAgainstHEAD(stashName, fileName);

            logger_.AddLog(cmd);
            CreateGitRunner().RunWithoutWaiting(cmd);
        }
Exemple #2
0
        public async Task <List <StashedFileInfo> > GetStashedFileInfosAsync(string stashName)
        {
            List <StashedFileInfo> outputs = new List <StashedFileInfo>();

            {
                string        cmd   = GitCommandCreator.StashModifiedFileList(stashName);
                List <string> lines = await CreateGitRunner().RunAsync(cmd);

                foreach (string line in lines)
                {
                    var splitted = line.Split("\t");
                    Debug.Assert(splitted.Length >= 2);
                    StashedFileInfo stashedFileInfo = new StashedFileInfo();
                    stashedFileInfo.FileType = StashedFileInfo.StashedFileType.kModified;
                    stashedFileInfo.Status   = splitted[0];
                    stashedFileInfo.Filename = splitted[1];

                    outputs.Add(stashedFileInfo);
                }
            }
            {
                string        cmd   = GitCommandCreator.StashUntrackedFileListWithCommitId(stashName);
                List <string> lines = await CreateGitRunner().RunAsync(cmd);

                lines.RemoveAt(0); // skip commit id
                foreach (string line in lines)
                {
                    var splitted = line.Split("\t");
                    Debug.Assert(splitted.Length >= 2);
                    StashedFileInfo stashedFileInfo = new StashedFileInfo();
                    stashedFileInfo.FileType = StashedFileInfo.StashedFileType.kUntracked;
                    stashedFileInfo.Status   = splitted[0];
                    stashedFileInfo.Filename = splitted[1];

                    outputs.Add(stashedFileInfo);
                }
            }
            return(outputs);
        }