Add support for git push with custom headers#2011
Closed
evolvedlight wants to merge 3 commits intolibgit2:masterfrom
Closed
Add support for git push with custom headers#2011evolvedlight wants to merge 3 commits intolibgit2:masterfrom
evolvedlight wants to merge 3 commits intolibgit2:masterfrom
Conversation
JackLiang5
approved these changes
Apr 28, 2023
JackLiang5
reviewed
Apr 28, 2023
| PackbuilderDegreeOfParallelism = pushOptions.PackbuilderDegreeOfParallelism, | ||
| RemoteCallbacks = gitCallbacks, | ||
| ProxyOptions = new GitProxyOptions { Version = 1 }, | ||
| CustomHeaders = pushOptions.CustomHeaders?.Length > 0 ? GitStrArrayManaged.BuildFrom(pushOptions.CustomHeaders) : new GitStrArrayManaged() |
There was a problem hiding this comment.
Is null better than new GitStrArrayManaged() here?
There was a problem hiding this comment.
The CustomHeaders field is of type GitStrArrayManaged, which is a struct type so non-nullable value type. So not without some other impacting modifications I think.
|
Without this it is also seemingly impossible to push to Azure repository using a personal access token. I wonder why it was exposed in FetchOptions but not in PushOptions. |
This was referenced Jun 6, 2023
James-LG
reviewed
Jul 25, 2023
| PackbuilderDegreeOfParallelism = pushOptions.PackbuilderDegreeOfParallelism, | ||
| RemoteCallbacks = gitCallbacks, | ||
| ProxyOptions = new GitProxyOptions { Version = 1 }, | ||
| CustomHeaders = pushOptions.CustomHeaders?.Length > 0 ? GitStrArrayManaged.BuildFrom(pushOptions.CustomHeaders) : new GitStrArrayManaged() |
Contributor
There was a problem hiding this comment.
GitStrArrayManaged needs to be disposed. I have a similar PR that does that here #2052 by following the pattern set by GitFetchOptionsWrapper.
Bump to master
Author
|
Sorry, somehow I missed the notifications on the comment. Will close in favor of #2052 |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is needed for pushing changes to bitbucket server repos