using System.Diagnostics;
using System.Globalization;
namespace Octokit
{
///
/// Upsed to update a Git reference.
///
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public class ReferenceUpdate
{
///
/// Initializes a new instance of the class.
///
/// The sha.
public ReferenceUpdate(string sha) : this(sha, false)
{
}
///
/// Initializes a new instance of the class.
///
/// The SHA1 value to set this reference to.
///
/// 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 you’re not overwriting work.
///
public ReferenceUpdate(string sha, bool force)
{
Ensure.ArgumentNotNullOrEmptyString(sha, "sha");
Sha = sha;
Force = force;
}
///
/// The SHA1 value to set this reference to.
///
///
/// The sha.
///
public string Sha { get; private set; }
///
/// 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 you’re not overwriting work.
///
///
/// true if force; otherwise, false.
///
public bool Force { get; private set; }
internal string DebuggerDisplay
{
get
{
return string.Format(CultureInfo.InvariantCulture, "Sha: {0} Force: {1}", Sha, Force);
}
}
}
}