Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2sharp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornulltoken <emeric.fermas@gmail.com>2011-06-30 21:25:53 +0400
committernulltoken <emeric.fermas@gmail.com>2011-07-14 17:53:17 +0400
commit2190049a692ca0334adce9e5b65af04a357e22ec (patch)
tree51fcb09db497c1f8a9e27801b2f3a5f7688cdc99 /LibGit2Sharp/RepositoryInformation.cs
parenta91fca509ce4bd56588496448a6d778ae2ba4e85 (diff)
Replace managed version of Repository.Info.IsHeadDetached with native libgit2 implementation
Diffstat (limited to 'LibGit2Sharp/RepositoryInformation.cs')
-rw-r--r--LibGit2Sharp/RepositoryInformation.cs6
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);
}
}
}