forked from libgit2/libgit2sharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request libgit2#2052 from James-LG/master
feat: Add CustomHeaders to PushOptions
- Loading branch information
Showing
4 changed files
with
98 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
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(); | ||
disposedValue = true; | ||
} | ||
|
||
public void Dispose() | ||
{ | ||
Dispose(true); | ||
} | ||
#endregion | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters