2121 */
2222GIT_BEGIN_DECL
2323
24+ /** @name Reference Functions
25+ *
26+ * These functions read, write and analyze references.
27+ */
28+ /**@{*/
29+
2430/**
2531 * Lookup a reference by name in a repository.
2632 *
@@ -263,12 +269,12 @@ GIT_EXTERN(const char *) git_reference_symbolic_target(const git_reference *ref)
263269/**
264270 * Get the type of a reference.
265271 *
266- * Either direct (GIT_REF_OID ) or symbolic (GIT_REF_SYMBOLIC )
272+ * Either direct (GIT_REFERENCE_DIRECT ) or symbolic (GIT_REFERENCE_SYMBOLIC )
267273 *
268274 * @param ref The reference
269275 * @return the type
270276 */
271- GIT_EXTERN (git_ref_t ) git_reference_type (const git_reference * ref );
277+ GIT_EXTERN (git_reference_t ) git_reference_type (const git_reference * ref ) ;
272278
273279/**
274280 * Get the full name of a reference.
@@ -640,15 +646,15 @@ typedef enum {
640646 /**
641647 * No particular normalization.
642648 */
643- GIT_REF_FORMAT_NORMAL = 0u ,
649+ GIT_REFERENCE_FORMAT_NORMAL = 0u ,
644650
645651 /**
646652 * Control whether one-level refnames are accepted
647653 * (i.e., refnames that do not contain multiple /-separated
648654 * components). Those are expected to be written only using
649655 * uppercase letters and underscore (FETCH_HEAD, ...)
650656 */
651- GIT_REF_FORMAT_ALLOW_ONELEVEL = (1u << 0 ),
657+ GIT_REFERENCE_FORMAT_ALLOW_ONELEVEL = (1u << 0 ),
652658
653659 /**
654660 * Interpret the provided name as a reference pattern for a
@@ -657,15 +663,15 @@ typedef enum {
657663 * in place of a one full pathname component
658664 * (e.g., foo/<star>/bar but not foo/bar<star>).
659665 */
660- GIT_REF_FORMAT_REFSPEC_PATTERN = (1u << 1 ),
666+ GIT_REFERENCE_FORMAT_REFSPEC_PATTERN = (1u << 1 ),
661667
662668 /**
663669 * Interpret the name as part of a refspec in shorthand form
664670 * so the `ONELEVEL` naming rules aren't enforced and 'master'
665671 * becomes a valid name.
666672 */
667- GIT_REF_FORMAT_REFSPEC_SHORTHAND = (1u << 2 ),
668- } git_reference_normalize_t ;
673+ GIT_REFERENCE_FORMAT_REFSPEC_SHORTHAND = (1u << 2 ),
674+ } git_reference_format_t ;
669675
670676/**
671677 * Normalize reference name and check validity.
@@ -683,7 +689,7 @@ typedef enum {
683689 * @param buffer_size Size of buffer_out
684690 * @param name Reference name to be checked.
685691 * @param flags Flags to constrain name validation rules - see the
686- * GIT_REF_FORMAT constants above.
692+ * GIT_REFERENCE_FORMAT constants above.
687693 * @return 0 on success, GIT_EBUFS if buffer is too small, GIT_EINVALIDSPEC
688694 * or an error code.
689695 */
@@ -743,6 +749,34 @@ GIT_EXTERN(int) git_reference_is_valid_name(const char *refname);
743749 */
744750GIT_EXTERN (const char * ) git_reference_shorthand (const git_reference * ref );
745751
752+ /**@}*/
753+
754+ /** @name Deprecated Reference Constants
755+ *
756+ * These enumeration values are retained for backward compatibility. The
757+ * newer versions of these functions should be preferred in all new code.
758+ */
759+ /**@{*/
760+
761+ /** Basic type of any Git reference. */
762+ #define git_ref_t git_reference_t
763+ #define git_reference_normalize_t git_reference_format_t
764+
765+ GIT_DEPRECATED (static const unsigned int ) GIT_REF_INVALID = GIT_REFERENCE_INVALID ;
766+ GIT_DEPRECATED (static const unsigned int ) GIT_REF_OID = GIT_REFERENCE_DIRECT ;
767+ GIT_DEPRECATED (static const unsigned int ) GIT_REF_SYMBOLIC = GIT_REFERENCE_SYMBOLIC ;
768+ GIT_DEPRECATED (static const unsigned int ) GIT_REF_LISTALL = GIT_REFERENCE_ALL ;
769+
770+ GIT_DEPRECATED (static const unsigned int ) GIT_REF_FORMAT_NORMAL =
771+ GIT_REFERENCE_FORMAT_NORMAL ;
772+ GIT_DEPRECATED (static const unsigned int ) GIT_REF_FORMAT_ALLOW_ONELEVEL =
773+ GIT_REFERENCE_FORMAT_ALLOW_ONELEVEL ;
774+ GIT_DEPRECATED (static const unsigned int ) GIT_REF_FORMAT_REFSPEC_PATTERN =
775+ GIT_REFERENCE_FORMAT_REFSPEC_PATTERN ;
776+ GIT_DEPRECATED (static const unsigned int ) GIT_REF_FORMAT_REFSPEC_SHORTHAND =
777+ GIT_REFERENCE_FORMAT_REFSPEC_SHORTHAND ;
778+
779+ /**@}*/
746780
747781/** @} */
748782GIT_END_DECL
0 commit comments