forked from libgit2/libgit2sharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStash.cs
More file actions
43 lines (39 loc) · 1.25 KB
/
Copy pathStash.cs
File metadata and controls
43 lines (39 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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, int index)
: base(repo, new DirectReference(string.Format("stash@{{{0}}}", index), 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; }
}
/// <summary>
/// Returns "stash@{i}", where i is the index of this <see cref="Stash"/>.
/// </summary>
protected override string Shorten()
{
return CanonicalName;
}
}
}