-
Notifications
You must be signed in to change notification settings - Fork 43
feat: add git clone with thinpack option to support self hosted azure devops #446
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
Changes from 1 commit
2a22162
e4fb15a
4653010
98985a2
cbd387e
af75d61
9e9bdde
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,6 +37,7 @@ type CloneRepoOptions struct { | |
Progress sideband.Progress | ||
Insecure bool | ||
SingleBranch bool | ||
ThinPack bool | ||
Depth int | ||
CABundle []byte | ||
ProxyOptions transport.ProxyOptions | ||
|
@@ -53,7 +54,7 @@ func CloneRepo(ctx context.Context, logf func(string, ...any), opts CloneRepoOpt | |
return false, fmt.Errorf("parse url %q: %w", opts.RepoURL, err) | ||
} | ||
logf("Parsed Git URL as %q", parsed.Redacted()) | ||
if parsed.Hostname() == "dev.azure.com" { | ||
if parsed.Hostname() == "dev.azure.com" || opts.ThinPack { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for this! Would you mind updating the logf message below? It still states that this is for azure specifically, which could be misleading if ThinPack were set in non Azure environments. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the semantics of the option as currently defined are also somewhat misleading. Setting There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I've updated the log message to differentiate between disabling the feature via the command line and disabling it due to encountering the corresponding domain.
I've adjusted the definition of the option. By default, the option is set to true, which enables Git clone thin pack compatibility. |
||
// Azure DevOps requires capabilities multi_ack / multi_ack_detailed, | ||
// which are not fully implemented and by default are included in | ||
// transport.UnsupportedCapabilities. | ||
|
@@ -347,6 +348,7 @@ func CloneOptionsFromOptions(logf func(string, ...any), options options.Options) | |
Storage: options.Filesystem, | ||
Insecure: options.Insecure, | ||
SingleBranch: options.GitCloneSingleBranch, | ||
ThinPack: options.GitCloneThinPack, | ||
Depth: int(options.GitCloneDepth), | ||
CABundle: caBundle, | ||
} | ||
|
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.
Can you add a note regarding the behaviour of thinpack here for repos hosted on
dev.zaure.com
?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.
I have added the description regarding the behavior of thinpack for repositories hosted on dev.zaure.com, where the option remains ineffective even when enabled. Thank you!