-
Notifications
You must be signed in to change notification settings - Fork 895
/
Copy pathGitPushOptionsWrapper.cs
38 lines (32 loc) · 1.01 KB
/
GitPushOptionsWrapper.cs
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
using System;
namespace LibGit2Sharp.Core
{
/// <summary>
/// Git push options wrapper. Disposable wrapper for <see cref="GitPushOptions"/>.
/// </summary>
internal class GitPushOptionsWrapper : IDisposable
{
public GitPushOptionsWrapper() : this(new GitPushOptions()) { }
public GitPushOptionsWrapper(GitPushOptions pushOptions)
{
this.Options = pushOptions;
}
public GitPushOptions Options { get; private set; }
#region IDisposable
private bool disposedValue = false; // To detect redundant calls
protected virtual void Dispose(bool disposing)
{
if (disposedValue)
return;
this.Options.CustomHeaders.Dispose();
this.Options.remote_push_options.Dispose();
EncodingMarshaler.Cleanup(Options.ProxyOptions.Url);
disposedValue = true;
}
public void Dispose()
{
Dispose(true);
}
#endregion
}
}