Files
octokit.net/Octokit/Models/Request/ReferenceUpdate.cs
2015-12-16 21:23:36 +02:00

62 lines
1.9 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System;
using System.Diagnostics;
using System.Globalization;
namespace Octokit
{
/// <summary>
/// Upsed to update a Git reference.
/// </summary>
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public class ReferenceUpdate
{
/// <summary>
/// Initializes a new instance of the <see cref="ReferenceUpdate"/> class.
/// </summary>
/// <param name="sha">The sha.</param>
public ReferenceUpdate(string sha) : this(sha, false)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="ReferenceUpdate"/> class.
/// </summary>
/// <param name="sha">The SHA1 value to set this reference to.</param>
/// <param name="force">
/// Indicates whether to force the update or to make sure the update is a fast-forward update. Leaving this
/// out or setting it to false will make sure youre not overwriting work.
/// </param>
public ReferenceUpdate(string sha, bool force)
{
Ensure.ArgumentNotNullOrEmptyString(sha, "sha");
Sha = sha;
Force = force;
}
/// <summary>
/// The SHA1 value to set this reference to.
/// </summary>
/// <value>
/// The sha.
/// </value>
public string Sha { get; private set; }
/// <summary>
/// Indicates whether to force the update or to make sure the update is a fast-forward update. Leaving this
/// out or setting it to false will make sure youre not overwriting work.
/// </summary>
/// <value>
/// <c>true</c> if force; otherwise, <c>false</c>.
/// </value>
public bool Force { get; private set; }
internal string DebuggerDisplay
{
get
{
return string.Format(CultureInfo.InvariantCulture, "Sha: {0} Force: {1}", Sha, Force);
}
}
}
}