Network.Fetch() accepts optional refspec#585
Conversation
LibGit2Sharp.Tests/FetchFixture.cs
Outdated
There was a problem hiding this comment.
If TagFetchMode.None is not specified, tags are fetched. I'm not happy about this. Maybe Fetch should use None if TagFetchMode is set to null and RefSpecs is specified?
There was a problem hiding this comment.
Not quite. Tags refs are only created locally if you get tags for stuff you're downloading anyway. These are the git-fetch semantics, and it's what you should expect by default.
There was a problem hiding this comment.
Note that the previous comment applies as long as the user hasn't overriden the tag auto-following option in their config.
Changed the signature to Network.Fetch(Remote, FetchOptions). As of libgit2#536, optional parameters should be grouped in a xxxOptions type. Network.Fetch() has currently 5 optional parameters, and a sixth one (RefSpecs) will be introduced soon.
Added Network.Fetch(Remote, IEnumerable<string>, [FetchOptions]) overload to allow for custom refspecs to be fetched. The refspecs are used only temporarily and not stored in the configuration. Fixes libgit2#572.
|
Regarding the memory-remote overload introduced in 1374884, I refactored the
|
|
Brilliant! |
Added RefSpecs property to FetchOptions to allow for custom refspecs to
be fetched. The refspecs are used only temporarily and not stored in the
configuration.
Fixes #572. Depends on #584.
Maybe we should make
refSpecsan argument forFetchinstead of a property ofFetchOptions? It changes the semantics of the fetch operation significantly.