@@ -23,8 +23,7 @@ GIT_BEGIN_DECL
2323/**
2424 * Lookup a reference by its name in a repository.
2525 *
26- * The generated reference is owned by the repository and
27- * should not be freed by the user.
26+ * The generated reference must be freed by the user.
2827 *
2928 * @param reference_out pointer to the looked-up reference
3029 * @param repo the repository to look up the reference
@@ -39,8 +38,7 @@ GIT_EXTERN(int) git_reference_lookup(git_reference **reference_out, git_reposito
3938 * The reference will be created in the repository and written
4039 * to the disk.
4140 *
42- * This reference is owned by the repository and shall not
43- * be free'd by the user.
41+ * The generated reference must be freed by the user.
4442 *
4543 * If `force` is true and there already exists a reference
4644 * with the same name, it will be overwritten.
@@ -60,8 +58,7 @@ GIT_EXTERN(int) git_reference_create_symbolic(git_reference **ref_out, git_repos
6058 * The reference will be created in the repository and written
6159 * to the disk.
6260 *
63- * This reference is owned by the repository and shall not
64- * be free'd by the user.
61+ * The generated reference must be freed by the user.
6562 *
6663 * If `force` is true and there already exists a reference
6764 * with the same name, it will be overwritten.
@@ -173,7 +170,9 @@ GIT_EXTERN(int) git_reference_set_oid(git_reference *ref, const git_oid *id);
173170 * The new name will be checked for validity and may be
174171 * modified into a normalized form.
175172 *
176- * The refernece will be immediately renamed in-memory
173+ * The given git_reference will be updated.
174+ *
175+ * The reference will be immediately renamed in-memory
177176 * and on disk.
178177 *
179178 */
@@ -200,9 +199,6 @@ GIT_EXTERN(int) git_reference_delete(git_reference *ref);
200199 * Once the `packed-refs` file has been written properly,
201200 * the loose references will be removed from disk.
202201 *
203- * WARNING: calling this method may invalidate any existing
204- * references previously loaded on the cache.
205- *
206202 * @param repo Repository where the loose refs will be packed
207203 * @return GIT_SUCCESS or an error code
208204 */
@@ -253,6 +249,21 @@ GIT_EXTERN(int) git_reference_listall(git_strarray *array, git_repository *repo,
253249 */
254250GIT_EXTERN (int ) git_reference_foreach (git_repository * repo , unsigned int list_flags , int (* callback )(const char * , void * ), void * payload );
255251
252+ /**
253+ * Check if a reference is packed
254+ *
255+ * @param ref git_reference
256+ * @return 0 in case it's not packed; 1 otherwise
257+ */
258+ GIT_EXTERN (int ) git_reference_is_packed (git_reference * ref );
259+
260+ /**
261+ * Free the given reference
262+ *
263+ * @param ref git_reference
264+ */
265+ GIT_EXTERN (void ) git_reference_free (git_reference * ref );
266+
256267/** @} */
257268GIT_END_DECL
258269#endif
0 commit comments