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:
authorMetalrom <romain.magny@gmail.com>2013-02-01 20:31:20 +0400
committernulltoken <emeric.fermas@gmail.com>2013-02-28 15:34:55 +0400
commit0ab83f0808a23a9ef199ec5cdc4eee69f13ccddf (patch)
tree6ce2e15e61a17513c0d2a86a365c55ead1853737 /LibGit2Sharp/Stash.cs
parent9dfa8c16770a5b41d4303c230d41c7eb4297be45 (diff)
Add Repository.Stashes.Add
Diffstat (limited to 'LibGit2Sharp/Stash.cs')
-rw-r--r--LibGit2Sharp/Stash.cs41
1 files changed, 41 insertions, 0 deletions
diff --git a/LibGit2Sharp/Stash.cs b/LibGit2Sharp/Stash.cs
new file mode 100644
index 00000000..925dbee8
--- /dev/null
+++ b/LibGit2Sharp/Stash.cs
@@ -0,0 +1,41 @@
+namespace LibGit2Sharp
+{
+ ///<summary>
+ /// A Stash
+ /// <para>A stash is a snapshot of the dirty state of the working directory (i.e. the modified tracked files and staged changes)</para>
+ ///</summary>
+ public class Stash : ReferenceWrapper<Commit>
+ {
+ /// <summary>
+ /// Needed for mocking purposes.
+ /// </summary>
+ protected Stash()
+ { }
+
+ internal Stash(Repository repo, ObjectId targetId)
+ : base(repo, new DirectReference("stash@{0}", repo, targetId), r => r.CanonicalName)
+ {
+ }
+
+ /// <summary>
+ /// Gets the <see cref = "Commit" /> that this stash points to.
+ /// </summary>
+ public virtual Commit Target
+ {
+ get { return TargetObject; }
+ }
+
+ /// <summary>
+ /// Gets the message associated to this <see cref="Stash"/>.
+ /// </summary>
+ public virtual string Message
+ {
+ get { return Target.Message; }
+ }
+
+ protected override string Shorten()
+ {
+ return CanonicalName;
+ }
+ }
+}