-
Notifications
You must be signed in to change notification settings - Fork 897
Add support for git push with custom headers #2011
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -376,6 +376,7 @@ public virtual void Push(Remote remote, IEnumerable<string> pushRefSpecs, PushOp | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is null better than new GitStrArrayManaged() here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
@@ -376,6 +376,7 @@ public virtual void Push(Remote remote, IEnumerable<string> pushRefSpecs, PushOp | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
Sorry, somehow I missed the notifications on the comment. Will close in favor of #2052 |
This is needed for pushing changes to bitbucket server repos