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 #ifndef INCLUDE_sys_git_refdb_h__
8 #define INCLUDE_sys_git_refdb_h__
9 
10 #include "git2/common.h"
11 #include "git2/types.h"
12 #include "git2/oid.h"
13 
14 /**
15  * @file git2/sys/refs.h
16  * @brief Low-level Git ref creation
17  * @defgroup git_backend Git custom backend APIs
18  * @ingroup Git
19  * @{
20  */
21 GIT_BEGIN_DECL
22 
23 /**
24  * Create a new direct reference from an OID.
25  *
26  * @param name the reference name
27  * @param oid the object id for a direct reference
28  * @param peel the first non-tag object's OID, or NULL
29  * @return the created git_reference or NULL on error
30  */
31 GIT_EXTERN(git_reference *) git_reference__alloc(
32 	const char *name,
33 	const git_oid *oid,
34 	const git_oid *peel);
35 
36 /**
37  * Create a new symbolic reference.
38  *
39  * @param name the reference name
40  * @param target the target for a symbolic reference
41  * @return the created git_reference or NULL on error
42  */
43 GIT_EXTERN(git_reference *) git_reference__alloc_symbolic(
44 	const char *name,
45 	const char *target);
46 
47 /** @} */
48 GIT_END_DECL
49 #endif
50