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:
Diffstat (limited to 'LibGit2Sharp/Repository.cs')
-rw-r--r--LibGit2Sharp/Repository.cs10
1 files changed, 9 insertions, 1 deletions
diff --git a/LibGit2Sharp/Repository.cs b/LibGit2Sharp/Repository.cs
index 2593bcb3..680d9670 100644
--- a/LibGit2Sharp/Repository.cs
+++ b/LibGit2Sharp/Repository.cs
@@ -101,7 +101,15 @@ namespace LibGit2Sharp
/// </summary>
public Index Index
{
- get { return index; }
+ get
+ {
+ if (index == null)
+ {
+ throw new LibGit2Exception("Index is not available in a bare repository.");
+ }
+
+ return index;
+ }
}
/// <summary>