tgstation-server  4.4.0
The /tg/station 13 server suite
LibGit2Commands.cs
Go to the documentation of this file.
1 using LibGit2Sharp;
2 using System;
3 using System.Collections.Generic;
4 
5 namespace Tgstation.Server.Host.Components.Repository
6 {
9  {
11  public void Checkout(LibGit2Sharp.IRepository libGit2Repo, CheckoutOptions checkoutOptions, string commitish)
12  => Commands.Checkout(libGit2Repo, commitish, checkoutOptions);
13 
15  public void Fetch(
16  LibGit2Sharp.IRepository libGit2Repo,
17  IEnumerable<string> refSpecs,
18  Remote remote,
19  FetchOptions fetchOptions,
20  string logMessage)
21  {
22  if (libGit2Repo == null)
23  throw new ArgumentNullException(nameof(libGit2Repo));
24 
25  if (!(libGit2Repo is LibGit2Sharp.Repository concreteRepo))
26  throw new ArgumentException("libGit2Repo must be an instance of LibGit2Sharp.Repository!", nameof(libGit2Repo));
27 
28  if (remote == null)
29  throw new ArgumentNullException(nameof(remote));
30 
31  Commands.Fetch(concreteRepo, remote.Name, refSpecs, fetchOptions, logMessage);
32  }
33  }
34 }
void Checkout(LibGit2Sharp.IRepository repository, CheckoutOptions checkoutOptions, string commitish)
Runs a blocking checkout operation on a given repository .
void Fetch(LibGit2Sharp.IRepository libGit2Repo, IEnumerable< string > refSpecs, Remote remote, FetchOptions fetchOptions, string logMessage)
Runs a blocking fetch operation on a given repository .
For low level interactions with a LibGit2Sharp.IRepository.