本文整理汇总了C#中UntrackedFilesMode类的典型用法代码示例。如果您正苦于以下问题:C# UntrackedFilesMode类的具体用法?C# UntrackedFilesMode怎么用?C# UntrackedFilesMode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UntrackedFilesMode类属于命名空间,在下文中一共展示了UntrackedFilesMode类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetAllChangedFiles
public IList<GitItemStatus> GetAllChangedFiles(bool excludeIgnoredFiles = true, UntrackedFilesMode untrackedFiles = UntrackedFilesMode.Default)
{
var status = RunGitCmd(GitCommandHelpers.GetAllChangedFilesCmd(excludeIgnoredFiles, untrackedFiles));
return GitCommandHelpers.GetAllChangedFilesFromString(this, status);
}
示例2: GetAllChangedFilesWithSubmodulesStatus
public IList<GitItemStatus> GetAllChangedFilesWithSubmodulesStatus(bool excludeIgnoredFiles = true, UntrackedFilesMode untrackedFiles = UntrackedFilesMode.Default)
{
var status = GetAllChangedFiles(excludeIgnoredFiles, untrackedFiles);
GetCurrentSubmoduleStatus(status);
return status;
}
示例3: GitStatus
public IList<GitItemStatus> GitStatus(UntrackedFilesMode untrackedFilesMode, IgnoreSubmodulesMode ignoreSubmodulesMode)
{
if (!GitCommandHelpers.VersionInUse.SupportGitStatusPorcelain)
throw new Exception("The version of git you are using is not supported for this action. Please upgrade to git 1.7.3 or newer.");
string command = GitCommandHelpers.GetAllChangedFilesCmd(true, untrackedFilesMode, ignoreSubmodulesMode);
string status = RunGitCmd(command);
return GitCommandHelpers.GetAllChangedFilesFromString(this, status);
}
示例4: GitStatus
public IList<GitItemStatus> GitStatus(UntrackedFilesMode untrackedFilesMode, IgnoreSubmodulesMode ignoreSubmodulesMode = 0)
{
string command = GitCommandHelpers.GetAllChangedFilesCmd(true, untrackedFilesMode, ignoreSubmodulesMode);
string status = RunGitCmd(command);
return GitCommandHelpers.GetAllChangedFilesFromString(this, status);
}
示例5: GetAllChangedFiles
public IList<GitItemStatus> GetAllChangedFiles(bool excludeIgnoredFiles = true, bool excludeAssumeUnchangedFiles = true, UntrackedFilesMode untrackedFiles = UntrackedFilesMode.Default)
{
var status = RunGitCmd(GitCommandHelpers.GetAllChangedFilesCmd(excludeIgnoredFiles, untrackedFiles));
List<GitItemStatus> result = GitCommandHelpers.GetAllChangedFilesFromString(this, status);
if (!excludeAssumeUnchangedFiles)
{
string lsOutput = RunGitCmd("ls-files -v");
result.AddRange(GitCommandHelpers.GetAssumeUnchangedFilesFromString(this, lsOutput));
}
return result;
}
示例6: GetAllChangedFilesCmd
public static string GetAllChangedFilesCmd(bool excludeIgnoredFiles, UntrackedFilesMode untrackedFiles, IgnoreSubmodulesMode ignoreSubmodules)
{
if (!VersionInUse.SupportGitStatusPorcelain)
throw new Exception("The version of git you are using is not supported for this action. Please upgrade to git 1.7.3 or newer.");
StringBuilder stringBuilder = new StringBuilder("status --porcelain -z");
switch(untrackedFiles)
{
case UntrackedFilesMode.Default:
stringBuilder.Append(" --untracked-files");
break;
case UntrackedFilesMode.No:
stringBuilder.Append(" --untracked-files=no");
break;
case UntrackedFilesMode.Normal:
stringBuilder.Append(" --untracked-files=normal");
break;
case UntrackedFilesMode.All:
stringBuilder.Append(" --untracked-files=all");
break;
}
switch (ignoreSubmodules)
{
case IgnoreSubmodulesMode.Default:
stringBuilder.Append(" --ignore-submodules");
break;
case IgnoreSubmodulesMode.None:
stringBuilder.Append(" --ignore-submodules=none");
break;
case IgnoreSubmodulesMode.Untracked:
stringBuilder.Append(" --ignore-submodules=untracked");
break;
case IgnoreSubmodulesMode.Dirty:
stringBuilder.Append(" --ignore-submodules=dirty");
break;
case IgnoreSubmodulesMode.All:
stringBuilder.Append(" --ignore-submodules=all");
break;
}
if (!excludeIgnoredFiles)
stringBuilder.Append(" --ignored");
return stringBuilder.ToString();
}
示例7: GetAllChangedFilesCmd
public static string GetAllChangedFilesCmd(bool excludeIgnoredFiles, UntrackedFilesMode untrackedFiles, IgnoreSubmodulesMode ignoreSubmodules = 0)
{
StringBuilder stringBuilder = new StringBuilder("status --porcelain -z");
switch (untrackedFiles)
{
case UntrackedFilesMode.Default:
stringBuilder.Append(" --untracked-files");
break;
case UntrackedFilesMode.No:
stringBuilder.Append(" --untracked-files=no");
break;
case UntrackedFilesMode.Normal:
stringBuilder.Append(" --untracked-files=normal");
break;
case UntrackedFilesMode.All:
stringBuilder.Append(" --untracked-files=all");
break;
}
switch (ignoreSubmodules)
{
case IgnoreSubmodulesMode.Default:
stringBuilder.Append(" --ignore-submodules");
break;
case IgnoreSubmodulesMode.None:
stringBuilder.Append(" --ignore-submodules=none");
break;
case IgnoreSubmodulesMode.Untracked:
stringBuilder.Append(" --ignore-submodules=untracked");
break;
case IgnoreSubmodulesMode.Dirty:
stringBuilder.Append(" --ignore-submodules=dirty");
break;
case IgnoreSubmodulesMode.All:
stringBuilder.Append(" --ignore-submodules=all");
break;
}
if (!excludeIgnoredFiles)
stringBuilder.Append(" --ignored");
return stringBuilder.ToString();
}