@@ -729,11 +729,60 @@ Remote_push(Remote *self, PyObject *args)
729
729
}
730
730
731
731
732
+ PyDoc_STRVAR (Remote_add_push__doc__ ,
733
+ "add_push(refspec)\n"
734
+ "\n"
735
+ "Add a push refspec to the remote." );
736
+
737
+ PyObject *
738
+ Remote_add_push (Remote * self , PyObject * args )
739
+ {
740
+ git_remote * remote ;
741
+ char * refspec = NULL ;
742
+ int err = 0 ;
743
+
744
+ if (!PyArg_ParseTuple (args , "s" , & refspec ))
745
+ return NULL ;
746
+
747
+ remote = self -> remote ;
748
+ err = git_remote_add_push (remote , refspec );
749
+ if (err < 0 )
750
+ return Error_set (err );
751
+
752
+ Py_RETURN_NONE ;
753
+ }
754
+
755
+
756
+ PyDoc_STRVAR (Remote_add_fetch__doc__ ,
757
+ "add_fetch(refspec)\n"
758
+ "\n"
759
+ "Add a fetch refspec to the remote." );
760
+
761
+ PyObject *
762
+ Remote_add_fetch (Remote * self , PyObject * args )
763
+ {
764
+ git_remote * remote ;
765
+ char * refspec = NULL ;
766
+ int err = 0 ;
767
+
768
+ if (!PyArg_ParseTuple (args , "s" , & refspec ))
769
+ return NULL ;
770
+
771
+ remote = self -> remote ;
772
+ err = git_remote_add_fetch (remote , refspec );
773
+ if (err < 0 )
774
+ return Error_set (err );
775
+
776
+ Py_RETURN_NONE ;
777
+ }
778
+
732
779
PyMethodDef Remote_methods [] = {
733
780
METHOD (Remote , fetch , METH_NOARGS ),
734
781
METHOD (Remote , save , METH_NOARGS ),
735
782
METHOD (Remote , get_refspec , METH_O ),
736
783
METHOD (Remote , push , METH_VARARGS ),
784
+ METHOD (Remote , add_push , METH_VARARGS ),
785
+ METHOD (Remote , add_fetch , METH_VARARGS ),
737
786
METHOD (Remote , get_fetch_refspecs , METH_NOARGS ),
738
787
METHOD (Remote , set_fetch_refspecs , METH_O ),
739
788
METHOD (Remote , get_push_refspecs , METH_NOARGS ),
0 commit comments