string rootedPath = Repository.Init("D:\temp\rooted\path");
Console.WriteLine(rootedPath); // "D:\temp\rooted\path\.git\"
This file has been truncated, but you can view the full file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Test] | |
public void CanListMergeCommits() | |
{ | |
using (var repo = new Repository(@"D:\temp\Linux\linux-2.6")) | |
{ | |
var cs = repo.Commits.Where(c => c.ParentsCount > 1); | |
foreach (var c in cs) | |
{ | |
Console.WriteLine("{0} : {1} - {2}", c.Committer.When.ToString("o"), c.Sha, c.ParentsCount); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
namespace ConsoleApplication97854 | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
/* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "clar_libgit2.h" | |
#include "path.h" | |
#include "fileops.h" | |
#include "remote.h" | |
git_repository *repo; | |
git_remote *remote; | |
void test_network_fetch__initialize(void) | |
{ | |
cl_git_pass(git_repository_init(&repo, "fetched", false)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Fact] | |
public void RetrievingTheStatusOfARepositoryReturnNativeFilePaths() | |
{ | |
// Initialize a new repository | |
SelfCleaningDirectory scd = BuildSelfCleaningDirectory(); | |
const string directoryName = "directory"; | |
const string fileName = "Testfile.txt"; | |
// Create a file and insert some content |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Fact] | |
public void RetrievingTheStatusOfAnEmptyRepositoryHonorsTheGitIgnoreDirectives() | |
{ | |
SelfCleaningDirectory scd = BuildSelfCleaningDirectory(); | |
using (Repository repo = Repository.Init(scd.DirectoryPath)) | |
{ | |
string relativePath = "look-ma.txt"; | |
string fullFilePath = Path.Combine(repo.Info.WorkingDirectory, relativePath); | |
File.WriteAllText(fullFilePath, "I'm going to be ignored!"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0039git-upload-pack /libgit2/libgit2.git.host=github.com.009b0536afcaa9c27105b184d2fccac1a7b9e778f27c HEAD.multi_ack thin-pack side-band side-band-64k ofs-delta shallow no-progress include-tag multi_ack_detailed | |
004432dc20b5af696724753ea54a4dacc3fa479774a1 refs/heads/clay-rename | |
004255f207110fac886861b100831305c32c94da01da refs/heads/clay-test | |
0049107e30e9c58facc3fdafefa7bb17ab6f04ddd2ec refs/heads/config-int-types | |
00478cd767ef52ad35331f082394ec93df8e57757120 refs/heads/config-parsing | |
00440536afcaa9c27105b184d2fccac1a7b9e778f27c refs/heads/development | |
004a4ef14af93517b3842bc0dfa24147cf10dd029582 refs/heads/development-merge | |
0047bdd31dd5e832126b2f22fccbe244a1106c241ab0 refs/heads/error-handling | |
0040d3789825d3823bdbbebe278172345243618ca541 refs/heads/fileops | |
0040ce49c7a8a902bd3a74a59a356dd11886e83d2e92 refs/heads/filters |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.IO; | |
using System.Linq; | |
using System.Text; | |
using LibGit2Sharp.Tests.TestHelpers; | |
using Xunit; | |
namespace LibGit2Sharp.Tests | |
{ | |
public class DiffTreeToTargetFixture : BaseFixture | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Fact] | |
/* | |
* $ git init . | |
* $ echo -ne 'a' > file.txt | |
* $ git add . | |
* $ git commit -m "No line ending" | |
* $ echo -ne '\n' >> file.txt | |
* $ git add . | |
* $ git diff --cached | |
* diff --git a/file.txt b/file.txt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.IO; | |
using System.Reflection; | |
using LibGit2Sharp; | |
namespace ConsoleApplication2 | |
{ | |
internal class Program | |
{ | |
private static void Main(string[] args) |
OlderNewer