本文整理汇总了C#中LibGit2Sharp.Repository.RemoveUntrackedFiles方法的典型用法代码示例。如果您正苦于以下问题:C# Repository.RemoveUntrackedFiles方法的具体用法?C# Repository.RemoveUntrackedFiles怎么用?C# Repository.RemoveUntrackedFiles使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LibGit2Sharp.Repository
的用法示例。
在下文中一共展示了Repository.RemoveUntrackedFiles方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CleanUpCurrentBranch
private void CleanUpCurrentBranch(Repository repository)
{
repository.Reset(ResetOptions.Hard);
repository.RemoveUntrackedFiles();
repository.Head.Remote.Fetch();
}
示例2: Clean
public void Clean()
{
using (var repo = new LibGit2Sharp.Repository(RepositoryPath))
{
repo.RemoveUntrackedFiles();
}
}
示例3: Pull
private static bool Pull(string directory)
{
try
{
using (var repo = new Repository(directory))
{
Utility.Log(LogStatus.Info, "Pull", directory, Logs.MainLog);
repo.Reset(ResetMode.Hard);
repo.RemoveUntrackedFiles();
repo.Network.Pull(
new Signature(Config.Instance.Username, $"{Config.Instance.Username}@joduska.me", DateTimeOffset.Now),
new PullOptions
{
MergeOptions =
new MergeOptions
{
FastForwardStrategy = FastForwardStrategy.Default,
FileConflictStrategy = CheckoutFileConflictStrategy.Theirs,
MergeFileFavor = MergeFileFavor.Theirs,
CommitOnSuccess = true
}
});
repo.Checkout(repo.Head, new CheckoutOptions { CheckoutModifiers = CheckoutModifiers.Force });
if (repo.Info.IsHeadDetached)
{
Utility.Log(LogStatus.Error, "Pull", "Update+Detached", Logs.MainLog);
}
}
return true;
}
catch (Exception e)
{
Utility.Log(LogStatus.Error, "Pull", e.Message, Logs.MainLog);
return false;
}
}