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:
authorKeith Dahlby <dahlbyk@gmail.com>2012-04-14 20:09:33 +0400
committernulltoken <emeric.fermas@gmail.com>2012-04-15 14:38:55 +0400
commit157ee6f29cd255bba847f1cc4b2364da23c4c8e7 (patch)
treeeed27b4f890261014e42b9ad91c0852e5e39085e /LibGit2Sharp
parent1b00c6833b690897ea3572ec9e210394cd6e43be (diff)
Throw when accessing Index of a bare repository
Diffstat (limited to 'LibGit2Sharp')
-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>