diff options
author | Edward Thomson <ethomson@edwardthomson.com> | 2021-01-31 00:36:54 +0000 |
---|---|---|
committer | Edward Thomson <ethomson@edwardthomson.com> | 2021-01-31 16:36:31 +0000 |
commit | 4732e03056b1b88fdeb3276d96dfd9400d75233a (patch) | |
tree | 6fee140f07bc425a16caa5c08ac39ef8bc993c8a /include/git2 | |
parent | 50f536222b6576a4204b980978d6094770a21038 (diff) | |
download | libgit2-ethomson/revparse.tar.gz |
revspec: rename git_revparse_mode_t to git_revspec_tethomson/revparse
The information about the type of a revision spec is not information
about the parser. Name it accordingly, so that `git_revparse_mode_t`
is now `git_revspec_t`. Deprecate the old name.
Diffstat (limited to 'include/git2')
-rw-r--r-- | include/git2/deprecated.h | 21 | ||||
-rw-r--r-- | include/git2/revparse.h | 10 |
2 files changed, 26 insertions, 5 deletions
diff --git a/include/git2/deprecated.h b/include/git2/deprecated.h index 79f637a7f..d18fffc0e 100644 --- a/include/git2/deprecated.h +++ b/include/git2/deprecated.h @@ -29,6 +29,7 @@ #include "trace.h" #include "repository.h" #include "revert.h" +#include "revparse.h" #include "stash.h" #include "status.h" #include "submodule.h" @@ -414,6 +415,25 @@ GIT_EXTERN(int) git_tag_create_frombuffer( /**@}*/ +/** @name Deprecated Revspec Constants + * + * These enumeration values are retained for backward compatibility. + * The newer versions of these values should be preferred in all new + * code. + * + * There is no plan to remove these backward compatibility values at + * this time. + */ +/**@{*/ + +typedef git_revspec_t git_revparse_mode_t; + +#define GIT_REVPARSE_SINGLE GIT_REVSPEC_SINGLE +#define GIT_REVPARSE_RANGE GIT_REVSPEC_RANGE +#define GIT_REVPARSE_MERGE_BASE GIT_REVSPEC_MERGE_BASE + +/**@}*/ + /** @name Deprecated Credential Types * * These types are retained for backward compatibility. The newer @@ -422,6 +442,7 @@ GIT_EXTERN(int) git_tag_create_frombuffer( * There is no plan to remove these backward compatibility values at * this time. */ +/**@{*/ typedef git_credential git_cred; typedef git_credential_userpass_plaintext git_cred_userpass_plaintext; diff --git a/include/git2/revparse.h b/include/git2/revparse.h index d170e1621..e14ddee96 100644 --- a/include/git2/revparse.h +++ b/include/git2/revparse.h @@ -70,12 +70,12 @@ GIT_EXTERN(int) git_revparse_ext( */ typedef enum { /** The spec targeted a single object. */ - GIT_REVPARSE_SINGLE = 1 << 0, + GIT_REVSPEC_SINGLE = 1 << 0, /** The spec targeted a range of commits. */ - GIT_REVPARSE_RANGE = 1 << 1, + GIT_REVSPEC_RANGE = 1 << 1, /** The spec used the '...' operator, which invokes special semantics. */ - GIT_REVPARSE_MERGE_BASE = 1 << 2, -} git_revparse_mode_t; + GIT_REVSPEC_MERGE_BASE = 1 << 2, +} git_revspec_t; /** * Git Revision Spec: output of a `git_revparse` operation @@ -85,7 +85,7 @@ typedef struct { git_object *from; /** The right element of the revspec; must be freed by the user */ git_object *to; - /** The intent of the revspec (i.e. `git_revparse_mode_t` flags) */ + /** The intent of the revspec (i.e. `git_revspec_mode_t` flags) */ unsigned int flags; } git_revspec; |