Add support for remote refspecs
jdavid opened this issue · 7 comments
jdavid commented
There is a regression in the master branch regarding the 0.18.1
release. After the changes in libgit2 0.19
we have lost the Remote.fetchspec
setter. To get back the ability to modify remote's refspecs, and to do so properly, we need to:
- Implement a
Refspec
type, in a new filesrc/refspec.c
- Wrap more libgit2 functions in the
Remote
type
Volunteers?
jdavid commented
Hi @xtao and thank you for volunteering!
This is the API to implement.
Constants:
GIT_DIRECTION_FETCH
GIT_DIRECTION_PUSH
Refspec type, src/refspec.c
:
Refspec.direction => GIT_DIRECTION_FETCH / GIT_DIRECTION_PUSH
Refspec.dst => <str>
Refspec.dst_matches(refname:<str>) => True / False
Refspec.force => True/False
Refspec.src => <str>
Refspec.src_matches(refname:<str>) => True/False
Refspec.string => <str>
Remote type, remote.c
:
Remote.add_fetch(refspec:<str>) => None
Remote.add_push(refspec:<str>) => None
Remote.clear_refspecs() => None
Remote.get_fetch_refspecs() => [<str>, ...]
Remote.get_push_refspecs() => [<str>, ...]
Remote.get_refspec(n:<int>) => <Refspec>
Remote.remove_refspec(n:<int>) => None
Note that:
- We target libgit2
0.19
, http://libgit2.github.com/libgit2/#v0.19.0 - Tests and docs must be included
Do you have questions?
carlosmn commented
With libgit2 v0.20, we have the ability to set the fetch and push refspecs again. Removing the nth refspec isn't something we want to do anyway, so the only parts missing should be add_fetch
, and add_push
.
carlosmn commented
With the PRs that got merged recently, this can be closed, no?
jdavid commented
yes, thanks!
IfeanyiEkperi commented
Fixed #33