Commit 8d39f2a7 by Carlos Martín Nieto

refspec: add direction accessor

parent 41578510
......@@ -52,6 +52,14 @@ GIT_EXTERN(const char *) git_refspec_string(const git_refspec *refspec);
GIT_EXTERN(int) git_refspec_force(const git_refspec *refspec);
/**
* Get the refspec's direction.
*
* @param the refspec
* @return GIT_DIRECTION_FETCH or GIT_DIRECTION_PUSH
*/
GIT_EXTERN(git_direction) git_refspec_direction(const git_refspec *spec);
/**
* Check if a refspec's source descriptor matches a reference
*
* @param refspec the refspec
......
......@@ -274,3 +274,10 @@ int git_refspec_is_wildcard(const git_refspec *spec)
return (spec->src[strlen(spec->src) - 1] == '*');
}
git_direction git_refspec_direction(const git_refspec *spec)
{
assert(spec);
return spec->push;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment