Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions LibGit2Sharp/Core/GitPushOptionsWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ protected virtual void Dispose(bool disposing)
return;

this.Options.CustomHeaders.Dispose();
this.Options.remote_push_options.Dispose();
EncodingMarshaler.Cleanup(Options.ProxyOptions.Url);
disposedValue = true;
}
Expand Down
6 changes: 6 additions & 0 deletions LibGit2Sharp/Network.cs
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,12 @@ public virtual void Push(Remote remote, IEnumerable<string> pushRefSpecs, PushOp
gitPushOptions.CustomHeaders = GitStrArrayManaged.BuildFrom(pushOptions.CustomHeaders);
}

// If there are remot-push-options, create a managed string array.
if (pushOptions.RemotePushOptions != null && pushOptions.RemotePushOptions.Length > 0)
{
gitPushOptions.remote_push_options = GitStrArrayManaged.BuildFrom(pushOptions.RemotePushOptions);
}

Proxy.git_remote_push(remoteHandle,
pushRefSpecs,
gitPushOptions);
Expand Down
6 changes: 6 additions & 0 deletions LibGit2Sharp/PushOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,11 @@ public sealed class PushOptions
/// Options for connecting through a proxy.
/// </summary>
public ProxyOptions ProxyOptions { get; set; } = new();

/// <summary>
/// This string is sent to the server.
/// This parameter is equivalent to the value set in the git command line "--push-options".
/// </summary>
public string[] RemotePushOptions { get; set; }
}
}