Skip to content

Commit 7e7859a

Browse files
committed
object_type: update enumeration names
Update the `git_otype` names to reflect our current naming conventions. `git_otype` is now `git_object_t` and the `GIT_OBJ_*` values are now `GIT_OBJECT_*` values. The old macro, enumeration and structure names are retained and simply set to the new names.
1 parent 4e892ae commit 7e7859a

File tree

1 file changed

+35
-11
lines changed

1 file changed

+35
-11
lines changed

include/git2/types.h

Lines changed: 35 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -68,17 +68,17 @@ typedef int64_t git_time_t;
6868

6969
/** Basic type (loose or packed) of any Git object. */
7070
typedef enum {
71-
GIT_OBJ_ANY = -2, /**< Object can be any of the following */
72-
GIT_OBJ_BAD = -1, /**< Object is invalid. */
73-
GIT_OBJ__EXT1 = 0, /**< Reserved for future use. */
74-
GIT_OBJ_COMMIT = 1, /**< A commit object. */
75-
GIT_OBJ_TREE = 2, /**< A tree (directory listing) object. */
76-
GIT_OBJ_BLOB = 3, /**< A file revision object. */
77-
GIT_OBJ_TAG = 4, /**< An annotated tag object. */
78-
GIT_OBJ__EXT2 = 5, /**< Reserved for future use. */
79-
GIT_OBJ_OFS_DELTA = 6, /**< A delta, base is given by an offset. */
80-
GIT_OBJ_REF_DELTA = 7, /**< A delta, base is given by object id. */
81-
} git_otype;
71+
GIT_OBJECT_ANY = -2, /**< Object can be any of the following */
72+
GIT_OBJECT_BAD = -1, /**< Object is invalid. */
73+
GIT_OBJECT__EXT1 = 0, /**< Reserved. */
74+
GIT_OBJECT_COMMIT = 1, /**< A commit object. */
75+
GIT_OBJECT_TREE = 2, /**< A tree (directory listing) object. */
76+
GIT_OBJECT_BLOB = 3, /**< A file revision object. */
77+
GIT_OBJECT_TAG = 4, /**< An annotated tag object. */
78+
GIT_OBJECT__EXT2 = 5, /**< Reserved. */
79+
GIT_OBJECT_OFS_DELTA = 6, /**< A delta, base is given by an offset. */
80+
GIT_OBJECT_REF_DELTA = 7, /**< A delta, base is given by object id. */
81+
} git_object_t;
8282

8383
/** An open object database handle. */
8484
typedef struct git_odb git_odb;
@@ -443,6 +443,30 @@ struct git_writestream {
443443
/** Representation of .mailmap file state. */
444444
typedef struct git_mailmap git_mailmap;
445445

446+
/** @name Deprecated Index Structures
447+
*
448+
* These macros, structures and enumerations are retained for backward
449+
* compatibility. The newer versions of these functions and structures
450+
* should be preferred in all new code.
451+
*/
452+
453+
/**@{*/
454+
455+
#define GIT_OBJ_ANY GIT_OBJECT_ANY
456+
#define GIT_OBJ_BAD GIT_OBJECT_BAD
457+
#define GIT_OBJ__EXT1 0
458+
#define GIT_OBJ_COMMIT GIT_OBJECT_COMMIT
459+
#define GIT_OBJ_TREE GIT_OBJECT_TREE
460+
#define GIT_OBJ_BLOB GIT_OBJECT_BLOB
461+
#define GIT_OBJ_TAG GIT_OBJECT_TAG
462+
#define GIT_OBJ__EXT2 5
463+
#define GIT_OBJ_OFS_DELTA GIT_OBJECT_OFS_DELTA
464+
#define GIT_OBJ_REF_DELTA GIT_OBJECT_REF_DELTA
465+
466+
#define git_otype git_object_t
467+
468+
/**@}*/
469+
446470
/** @} */
447471
GIT_END_DECL
448472

0 commit comments

Comments
 (0)