@@ -14,48 +14,46 @@ static void check_error(int error_code, const char *action)
1414 exit (1 );
1515}
1616
17- static int push_commit (git_revwalk * walk , git_object * obj , int hide )
17+ static int push_commit (git_revwalk * walk , git_oid * oid , int hide )
1818{
1919 if (hide )
20- return git_revwalk_hide (walk , git_object_id ( obj ) );
20+ return git_revwalk_hide (walk , oid );
2121 else
22- return git_revwalk_push (walk , git_object_id ( obj ) );
22+ return git_revwalk_push (walk , oid );
2323}
2424
2525static int push_spec (git_repository * repo , git_revwalk * walk , const char * spec , int hide )
2626{
2727 int error ;
28- git_object * obj ;
28+ git_oid oid ;
2929
30- if ((error = git_revparse_single ( & obj , repo , spec )))
30+ if ((error = git_revparse ( & oid , NULL , NULL , repo , spec )))
3131 return error ;
32- return push_commit (walk , obj , hide );
32+ return push_commit (walk , & oid , hide );
3333}
3434
3535static int push_range (git_repository * repo , git_revwalk * walk , const char * range , int hide )
3636{
37- git_object * left , * right ;
38- int threedots ;
37+ git_oid left , right ;
38+ git_revparse_flag_t flags ;
3939 int error = 0 ;
4040
41- if ((error = git_revparse_rangelike (& left , & right , & threedots , repo , range )))
41+ if ((error = git_revparse (& left , & right , & flags , repo , range )))
4242 return error ;
43- if (threedots ) {
43+ if (flags & GIT_REVPARSE_MERGE_BASE ) {
4444 /* TODO: support "<commit>...<commit>" */
4545 return GIT_EINVALIDSPEC ;
4646 }
4747
48- if ((error = push_commit (walk , left , !hide )))
48+ if ((error = push_commit (walk , & left , !hide )))
4949 goto out ;
50- error = push_commit (walk , right , hide );
50+ error = push_commit (walk , & right , hide );
5151
5252 out :
53- git_object_free (left );
54- git_object_free (right );
5553 return error ;
5654}
5755
58- static int revwalk_parseopts (git_repository * repo , git_revwalk * walk , int nopts , const char * const * opts )
56+ static int revwalk_parseopts (git_repository * repo , git_revwalk * walk , int nopts , char * * opts )
5957{
6058 int hide , i , error ;
6159 unsigned int sorting = GIT_SORT_NONE ;
0 commit comments