diff options
author | nulltoken <emeric.fermas@gmail.com> | 2011-06-30 21:25:53 +0400 |
---|---|---|
committer | nulltoken <emeric.fermas@gmail.com> | 2011-07-14 17:53:17 +0400 |
commit | 2190049a692ca0334adce9e5b65af04a357e22ec (patch) | |
tree | 51fcb09db497c1f8a9e27801b2f3a5f7688cdc99 /LibGit2Sharp/RepositoryInformation.cs | |
parent | a91fca509ce4bd56588496448a6d778ae2ba4e85 (diff) |
Replace managed version of Repository.Info.IsHeadDetached with native libgit2 implementation
Diffstat (limited to 'LibGit2Sharp/RepositoryInformation.cs')
-rw-r--r-- | LibGit2Sharp/RepositoryInformation.cs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/LibGit2Sharp/RepositoryInformation.cs b/LibGit2Sharp/RepositoryInformation.cs index c77c1ca9..555cd729 100644 --- a/LibGit2Sharp/RepositoryInformation.cs +++ b/LibGit2Sharp/RepositoryInformation.cs @@ -63,8 +63,10 @@ namespace LibGit2Sharp { get { - if (repo.Info.IsEmpty) return false; // Detached HEAD doesn't mean anything for an empty repo, just return false - return repo.Refs["HEAD"] is DirectReference; + var res = NativeMethods.git_repository_head_detached(repo.Handle); + Ensure.Success(res, true); + + return (res == 1); } } } |