source src/object_api.c
Line | Flow | Count | Block(s) | Source |
---|---|---|---|---|
1 | - | /* | ||
2 | - | * Copyright (C) the libgit2 contributors. All rights reserved. | ||
3 | - | * | ||
4 | - | * This file is part of libgit2, distributed under the GNU GPL v2 with | ||
5 | - | * a Linking Exception. For full terms see the included COPYING file. | ||
6 | - | */ | ||
7 | - | |||
8 | - | #include "common.h" | ||
9 | - | |||
10 | - | #include "git2/object.h" | ||
11 | - | |||
12 | - | #include "repository.h" | ||
13 | - | #include "commit.h" | ||
14 | - | #include "tree.h" | ||
15 | - | #include "blob.h" | ||
16 | - | #include "tag.h" | ||
17 | - | |||
18 | - | /** | ||
19 | - | * Commit | ||
20 | - | */ | ||
21 | 6458 | 2 | int git_commit_lookup(git_commit **out, git_repository *repo, const git_oid *id) | |
22 | - | { | ||
23 | 6458 | 2 | return git_object_lookup((git_object **)out, repo, id, GIT_OBJECT_COMMIT); | |
24 | - | } | ||
25 | - | |||
26 | ##### | 2 | int git_commit_lookup_prefix(git_commit **out, git_repository *repo, const git_oid *id, size_t len) | |
27 | - | { | ||
28 | ##### | 2 | return git_object_lookup_prefix((git_object **)out, repo, id, len, GIT_OBJECT_COMMIT); | |
29 | - | } | ||
30 | - | |||
31 | 7370 | 2 | void git_commit_free(git_commit *obj) | |
32 | - | { | ||
33 | 7370 | 2 | git_object_free((git_object *)obj); | |
34 | 7370 | 3 | } | |
35 | - | |||
36 | 295602 | 2 | const git_oid *git_commit_id(const git_commit *obj) | |
37 | - | { | ||
38 | 295602 | 2 | return git_object_id((const git_object *)obj); | |
39 | - | } | ||
40 | - | |||
41 | 348 | 2 | git_repository *git_commit_owner(const git_commit *obj) | |
42 | - | { | ||
43 | 348 | 2 | return git_object_owner((const git_object *)obj); | |
44 | - | } | ||
45 | - | |||
46 | 774 | 2 | int git_commit_dup(git_commit **out, git_commit *obj) | |
47 | - | { | ||
48 | 774 | 2 | return git_object_dup((git_object **)out, (git_object *)obj); | |
49 | - | } | ||
50 | - | |||
51 | - | /** | ||
52 | - | * Tree | ||
53 | - | */ | ||
54 | 201772 | 2 | int git_tree_lookup(git_tree **out, git_repository *repo, const git_oid *id) | |
55 | - | { | ||
56 | 201772 | 2 | return git_object_lookup((git_object **)out, repo, id, GIT_OBJECT_TREE); | |
57 | - | } | ||
58 | - | |||
59 | ##### | 2 | int git_tree_lookup_prefix(git_tree **out, git_repository *repo, const git_oid *id, size_t len) | |
60 | - | { | ||
61 | ##### | 2 | return git_object_lookup_prefix((git_object **)out, repo, id, len, GIT_OBJECT_TREE); | |
62 | - | } | ||
63 | - | |||
64 | 585342 | 2 | void git_tree_free(git_tree *obj) | |
65 | - | { | ||
66 | 585342 | 2 | git_object_free((git_object *)obj); | |
67 | 585242 | 3 | } | |
68 | - | |||
69 | 2102 | 2 | const git_oid *git_tree_id(const git_tree *obj) | |
70 | - | { | ||
71 | 2102 | 2 | return git_object_id((const git_object *)obj); | |
72 | - | } | ||
73 | - | |||
74 | 13356 | 2 | git_repository *git_tree_owner(const git_tree *obj) | |
75 | - | { | ||
76 | 13356 | 2 | return git_object_owner((const git_object *)obj); | |
77 | - | } | ||
78 | - | |||
79 | 204789 | 2 | int git_tree_dup(git_tree **out, git_tree *obj) | |
80 | - | { | ||
81 | 204789 | 2 | return git_object_dup((git_object **)out, (git_object *)obj); | |
82 | - | } | ||
83 | - | |||
84 | - | /** | ||
85 | - | * Tag | ||
86 | - | */ | ||
87 | 75 | 2 | int git_tag_lookup(git_tag **out, git_repository *repo, const git_oid *id) | |
88 | - | { | ||
89 | 75 | 2 | return git_object_lookup((git_object **)out, repo, id, GIT_OBJECT_TAG); | |
90 | - | } | ||
91 | - | |||
92 | ##### | 2 | int git_tag_lookup_prefix(git_tag **out, git_repository *repo, const git_oid *id, size_t len) | |
93 | - | { | ||
94 | ##### | 2 | return git_object_lookup_prefix((git_object **)out, repo, id, len, GIT_OBJECT_TAG); | |
95 | - | } | ||
96 | - | |||
97 | 191 | 2 | void git_tag_free(git_tag *obj) | |
98 | - | { | ||
99 | 191 | 2 | git_object_free((git_object *)obj); | |
100 | 191 | 3 | } | |
101 | - | |||
102 | 3 | 2 | const git_oid *git_tag_id(const git_tag *obj) | |
103 | - | { | ||
104 | 3 | 2 | return git_object_id((const git_object *)obj); | |
105 | - | } | ||
106 | - | |||
107 | ##### | 2 | git_repository *git_tag_owner(const git_tag *obj) | |
108 | - | { | ||
109 | ##### | 2 | return git_object_owner((const git_object *)obj); | |
110 | - | } | ||
111 | - | |||
112 | 3 | 2 | int git_tag_dup(git_tag **out, git_tag *obj) | |
113 | - | { | ||
114 | 3 | 2 | return git_object_dup((git_object **)out, (git_object *)obj); | |
115 | - | } | ||
116 | - | |||
117 | - | /** | ||
118 | - | * Blob | ||
119 | - | */ | ||
120 | 9673 | 2 | int git_blob_lookup(git_blob **out, git_repository *repo, const git_oid *id) | |
121 | - | { | ||
122 | 9673 | 2 | return git_object_lookup((git_object **)out, repo, id, GIT_OBJECT_BLOB); | |
123 | - | } | ||
124 | - | |||
125 | 54 | 2 | int git_blob_lookup_prefix(git_blob **out, git_repository *repo, const git_oid *id, size_t len) | |
126 | - | { | ||
127 | 54 | 2 | return git_object_lookup_prefix((git_object **)out, repo, id, len, GIT_OBJECT_BLOB); | |
128 | - | } | ||
129 | - | |||
130 | 188839 | 2 | void git_blob_free(git_blob *obj) | |
131 | - | { | ||
132 | 188839 | 2 | git_object_free((git_object *)obj); | |
133 | 188762 | 3 | } | |
134 | - | |||
135 | 10520 | 2 | const git_oid *git_blob_id(const git_blob *obj) | |
136 | - | { | ||
137 | 10520 | 2 | return git_object_id((const git_object *)obj); | |
138 | - | } | ||
139 | - | |||
140 | 102 | 2 | git_repository *git_blob_owner(const git_blob *obj) | |
141 | - | { | ||
142 | 102 | 2 | return git_object_owner((const git_object *)obj); | |
143 | - | } | ||
144 | - | |||
145 | 90 | 2 | int git_blob_dup(git_blob **out, git_blob *obj) | |
146 | - | { | ||
147 | 90 | 2 | return git_object_dup((git_object **)out, (git_object *)obj); | |
148 | - | } |