Skip to content

Instantly share code, notes, and snippets.

View nulltoken's full-sized avatar
💭
I may be slow to respond.

nulltoken nulltoken

💭
I may be slow to respond.
View GitHub Profile
@nulltoken
nulltoken / gist:976649
Created May 17, 2011 15:07
Redcarpet rendering issues?

Test

CSharp

C#

string rootedPath = Repository.Init("D:\temp\rooted\path");

Console.WriteLine(rootedPath);    // "D:\temp\rooted\path\.git\"
@nulltoken
nulltoken / gist:1917474
Created February 26, 2012 16:07
LibGit2Sharp issue 115
This file has been truncated, but you can view the full file.
[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);
@nulltoken
nulltoken / Program.cs
Created April 12, 2012 22:35
[LibGit2Sharp] *Untested* mocked proof of concept of a TreeDefinition - A building block to ease the generation of Trees in the odb
using System;
using System.Collections.Generic;
namespace ConsoleApplication97854
{
class Program
{
static void Main(string[] args)
{
/*
@nulltoken
nulltoken / fetch.c
Created May 8, 2012 10:55
[Libgit2] fetching
#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));
@nulltoken
nulltoken / status.fail.cs
Created May 8, 2012 21:06
(LibGit bug?] Surprisingly failing test
[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
@nulltoken
nulltoken / status.fail.2.cs
Created May 9, 2012 11:28
(LibGit bug?] Status failing test
[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!");
@nulltoken
nulltoken / dump.txt
Created May 9, 2012 13:13
[Libgit2] fetching libgit2 over git protocol
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
@nulltoken
nulltoken / diff.tests.cs
Created May 20, 2012 17:19
[Libgit2] Diff issues?
using System.IO;
using System.Linq;
using System.Text;
using LibGit2Sharp.Tests.TestHelpers;
using Xunit;
namespace LibGit2Sharp.Tests
{
public class DiffTreeToTargetFixture : BaseFixture
{
@nulltoken
nulltoken / CanCopeWithEndOfFileNewlineChanges.cs
Created May 21, 2012 09:32
[LibGit2Sharp] Line ending diff handling
[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
@nulltoken
nulltoken / LibGit2Sharp.Issue.153.cs
Created May 24, 2012 14:01
[LibGit2Sharp] Troubleshooting probing of the native dll on a network path
using System;
using System.IO;
using System.Reflection;
using LibGit2Sharp;
namespace ConsoleApplication2
{
internal class Program
{
private static void Main(string[] args)