File: refs.h

package info (click to toggle)
libgit2 1.9.1%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 60,804 kB
  • sloc: ansic: 203,436; javascript: 2,458; sh: 1,763; python: 384; perl: 99; php: 65; makefile: 33
file content (50 lines) | stat: -rw-r--r-- 1,213 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
 * Copyright (C) the libgit2 contributors. All rights reserved.
 *
 * This file is part of libgit2, distributed under the GNU GPL v2 with
 * a Linking Exception. For full terms see the included COPYING file.
 */
#ifndef INCLUDE_sys_git_refdb_h__
#define INCLUDE_sys_git_refdb_h__

#include "git2/common.h"
#include "git2/types.h"
#include "git2/oid.h"

/**
 * @file git2/sys/refs.h
 * @brief Low-level git reference creation
 * @defgroup git_backend Low-level git reference creation
 * @ingroup Git
 * @{
 */
GIT_BEGIN_DECL

/**
 * Create a new direct reference from an OID.
 *
 * @param name the reference name
 * @param oid the object id for a direct reference
 * @param peel the first non-tag object's OID, or NULL
 * @return the created git_reference or NULL on error
 */
GIT_EXTERN(git_reference *) git_reference__alloc(
	const char *name,
	const git_oid *oid,
	const git_oid *peel);

/**
 * Create a new symbolic reference.
 *
 * @param name the reference name
 * @param target the target for a symbolic reference
 * @return the created git_reference or NULL on error
 */
GIT_EXTERN(git_reference *) git_reference__alloc_symbolic(
	const char *name,
	const char *target);

/** @} */
GIT_END_DECL

#endif