mirror of
https://github.com/libgit2/libgit2.git
synced 2026-06-22 06:26:26 +00:00
specialrefdb: introduce a special reference database
This commit is contained in:
@@ -26,7 +26,7 @@
|
||||
#include "submodule.h"
|
||||
#include "diff_driver.h"
|
||||
#include "grafts.h"
|
||||
#include "specialrefs.h"
|
||||
#include "specialref.h"
|
||||
|
||||
#define DOT_GIT ".git"
|
||||
#define GIT_DIR DOT_GIT "/"
|
||||
|
||||
27
src/libgit2/specialref.c
Normal file
27
src/libgit2/specialref.c
Normal file
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "specialref.h"
|
||||
|
||||
#include "common.h"
|
||||
#include "refs.h"
|
||||
#include "repository.h"
|
||||
#include "specialrefdb.h"
|
||||
|
||||
#include "git2/types.h"
|
||||
#include "git2/refs.h"
|
||||
|
||||
int git_specialref_lookup_head(git_reference **out, git_repository *repo)
|
||||
{
|
||||
git_specialrefdb *db;
|
||||
int error;
|
||||
|
||||
if ((error = git_repository_specialrefdb__weakptr(&db, repo)) < 0)
|
||||
return error;
|
||||
|
||||
return git_specialrefdb_lookup_head(out, db);
|
||||
}
|
||||
16
src/libgit2/specialref.h
Normal file
16
src/libgit2/specialref.h
Normal file
@@ -0,0 +1,16 @@
|
||||
/*
|
||||
* 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_specialref_h__
|
||||
#define INCLUDE_specialref_h__
|
||||
|
||||
#include "common.h"
|
||||
|
||||
#include "git2/refs.h"
|
||||
|
||||
extern int git_specialref_lookup_head(git_reference **out, git_repository *repo);
|
||||
|
||||
#endif
|
||||
@@ -5,7 +5,7 @@
|
||||
* a Linking Exception. For full terms see the included COPYING file.
|
||||
*/
|
||||
|
||||
#include "specialrefs.h"
|
||||
#include "specialref.h"
|
||||
|
||||
#include "git2/sys/specialrefdb_backend.h"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user