﻿namespace GitFlowVersion
{
    using System.IO;

    public class GitDirFinder
    {

        public static string TreeWalkForGitDir(string currentDirectory)
        {
            while (true)
            {
                var gitDir = Path.Combine(currentDirectory, @".git");
                if (Directory.Exists(gitDir))
                {
                    return gitDir;
                }
                var parent = Directory.GetParent(currentDirectory);
                if (parent == null)
                {
                    break;
                }
                currentDirectory = parent.FullName;
            }
            return null;
        }
    }
}
﻿namespace GitFlowVersion
{
    using System.IO;
    using LibGit2Sharp;

    public class GitDirFinder
    {

        public static string TreeWalkForGitDir(string currentDirectory)
        {
            string gitDir = Repository.Discover(currentDirectory);

            if (gitDir != null)
            {
                return gitDir.TrimEnd(new []{ Path.DirectorySeparatorChar });
            }

            return null;
        }
    }
}
Make TreeWalkForGitDir() delegate to LibGit2Sharp
Make TreeWalkForGitDir() delegate to LibGit2Sharp

Fix #29
