mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-02 21:34:15 +00:00
refspec: add direction accessor
This commit is contained in:
parent
4157851076
commit
8d39f2a790
@ -51,6 +51,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
|
||||
*
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user