Ejemplo n.º 1
0
 /// <summary>
 /// Check out given paths from the index overwriting files in the working directory. Modified files might be overwritten.
 /// </summary>
 /// <param name="paths"></param>
 public void Checkout(params string[] paths)
 {
     GitIndex.RereadIfNecessary();
     foreach (var absolute_or_relative_path in paths)
     {
         string path = absolute_or_relative_path;
         if (Path.IsPathRooted(absolute_or_relative_path))
         {
             path = Core.Util.PathUtil.RelativePath(_repo.WorkingDirectory, absolute_or_relative_path);
         }
         var e = GitIndex.GetEntry(path);
         if (e == null)
         {
             continue;
         }
         GitIndex.checkoutEntry(new FileInfo(_repo.WorkingDirectory), e);
     }
 }