Allow configuting the Repository object created by PrepareFetch #1141
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.
In the process of implementing terminal prompt configuration (see #1093) I cannot find a way to apply this configuration when using
gix::prepare_clone()
, that is, before calling.fetch_only()
. There seems to be two alternatives to this:Remote::repo_mut()
method so that you can doremote.repo().config_snapshot_mut()
inPrepareFetch::configure_remote()
PrepareFetch::configure()
method which gives access to a&mut SnapshotMut<'_>
objectI don't like the first solution. You are supposed to have recevied the
Remote
from aRepository
and you should be able to do configuration from there. To my understanding theconfigure_{remote,transport}
methods exist because you can do advanced stuff with the respective object that is not directly coverend by cofngiration.I'm not too fond of the second option either (not least because there would be three different configuration methods on
PrepareFetch
), but I created this pull request to point out that there is currently no way to perform such configuration.(You may of course claim that
gix::prepare_clone
is a convenience method and that if you need to configure your repo, you should init an empty repo and fetch into it.)