diff options
author | nulltoken <emeric.fermas@gmail.com> | 2011-04-25 21:45:38 +0400 |
---|---|---|
committer | nulltoken <emeric.fermas@gmail.com> | 2011-04-25 21:45:38 +0400 |
commit | b13d80f00aef4eed5dbc1b8dcf19d5f8216c6359 (patch) | |
tree | e5519e638106243eca1d8f2fe33937bd2d4c6932 /LibGit2Sharp/RepositoryInformation.cs | |
parent | 1b097b3c4843c724604072cd068b4bd1685dba91 (diff) |
Rename Repository.Details to Repository.Info
Diffstat (limited to 'LibGit2Sharp/RepositoryInformation.cs')
-rw-r--r-- | LibGit2Sharp/RepositoryInformation.cs | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/LibGit2Sharp/RepositoryInformation.cs b/LibGit2Sharp/RepositoryInformation.cs new file mode 100644 index 00000000..6eb00568 --- /dev/null +++ b/LibGit2Sharp/RepositoryInformation.cs @@ -0,0 +1,44 @@ +using System.IO; +using LibGit2Sharp.Core; + +namespace LibGit2Sharp +{ + /// <summary> + /// Provides high level information about a repository. + /// </summary> + public class RepositoryInformation + { + private readonly Repository repo; + + internal RepositoryInformation(Repository repo, string posixPath, string posixWorkingDirectoryPath, bool isBare) + { + this.repo = repo; + Path = PosixPathHelper.ToNative(posixPath); + IsBare = isBare; + WorkingDirectory = PosixPathHelper.ToNative(posixWorkingDirectoryPath); + } + + /// <summary> + /// Gets the normalized path to the git repository. + /// </summary> + public string Path { get; private set; } + + /// <summary> + /// Gets the normalized path to the working directory. + /// <para> + /// Is the repository is bare, null is returned. + /// </para> + /// </summary> + public string WorkingDirectory { get; private set; } + + /// <summary> + /// Indicates whether the repository has a working directory. + /// </summary> + public bool IsBare { get; private set; } + + /// <summary> + /// Indicates whether the Head points to an arbitrary commit instead of the tip of a local banch. + /// </summary> + public bool IsHeadDetached { get { return repo.Refs.Head is DirectReference; } } + } +}
\ No newline at end of file |