-
Notifications
You must be signed in to change notification settings - Fork 874
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add CustomHeaders to PushOptions
Wires up CustomHeaders in PushOptions in the same vein as FetchOptions.
- Loading branch information
Showing
6 changed files
with
148 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
FROM mcr.microsoft.com/devcontainers/base:debian | ||
|
||
# Install .net 6 and .net 7 | ||
# https://learn.microsoft.com/en-us/dotnet/core/install/linux-debian | ||
RUN wget https://packages.microsoft.com/config/debian/11/packages-microsoft-prod.deb -O packages-microsoft-prod.deb && \ | ||
dpkg -i packages-microsoft-prod.deb && \ | ||
rm packages-microsoft-prod.deb | ||
RUN apt-get update -yq && \ | ||
apt-get install -yq --no-install-recommends \ | ||
dotnet-sdk-6.0 dotnet-sdk-7.0 | ||
|
||
# Install mono framework | ||
# https://www.mono-project.com/download/stable/#download-lin-debian | ||
RUN apt-get install -yq --no-install-recommends \ | ||
dirmngr ca-certificates gnupg | ||
RUN gpg --keyserver keyserver.ubuntu.com --recv 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF && \ | ||
gpg --export 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF | tee /usr/share/keyrings/mono.gpg >/dev/null && \ | ||
gpg --batch --yes --delete-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF && \ | ||
echo "deb [signed-by=/usr/share/keyrings/mono.gpg] https://download.mono-project.com/repo/debian stable-buster main" | tee /etc/apt/sources.list.d/mono-official-stable.list | ||
RUN apt-get update -yq && \ | ||
apt-get install -yq --no-install-recommends \ | ||
mono-devel |
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,28 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the | ||
// README at: https://github.com/devcontainers/templates/tree/main/src/dotnet | ||
{ | ||
"name": "C# (.NET)", | ||
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile | ||
"dockerFile": "Dockerfile", | ||
// Features to add to the dev container. More info: https://containers.dev/features. | ||
// "features": {}, | ||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
// "forwardPorts": [5000, 5001], | ||
// "portsAttributes": { | ||
// "5001": { | ||
// "protocol": "https" | ||
// } | ||
// } | ||
// Use 'postCreateCommand' to run commands after the container is created. | ||
// "postCreateCommand": "dotnet restore", | ||
// Configure tool-specific properties. | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"ms-dotnettools.csharp" | ||
] | ||
} | ||
} | ||
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. | ||
// "remoteUser": "root" | ||
} |
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