Functions
2.1 Annotated Commit
2.2 Blame
2.3 Blob
2.4 Branch
2.5 Buffer
2.6 Checkout
2.7 Cherrypick
2.8 Clone
2.9 Commit
2.10 Config
2.11 Credentials
2.12 Describe
2.13 Diff
2.14 Fetch
2.15 Filter
2.16 Errors
2.17 Graph
2.18 Ignore
2.19 Index
2.20 Indexer
2.21 Global
2.22 Merge
2.23 Message
2.24 Note
2.25 Object
2.26 Object Database
2.27 Oid
2.28 Oid Array
2.29 Packbuilder
2.30 Patch
2.31 Pathspec
2.32 Proxy
2.33 Push
2.34 Rebase
2.35 Refdb
2.36 Reference
2.37 Reflog
2.38 Refspec
2.39 Remote
2.40 Repository
2.41 Reset
2.42 Revert
2.43 Revparse
2.44 Revwalk
2.45 Signature
2.46 Stash
2.47 Status
2.48 Strarray
2.49 Submodule
2.50 Tag
2.51 Tree
2.52 Treebuilder
On this page:
git_  refdb_  backend_  fs
git_  refdb_  compress
git_  refdb_  free
git_  refdb_  init_  backend
git_  refdb_  new
git_  refdb_  open
git_  refdb_  set_  backend
7.7

2.35 Refdb

 (require libgit2/include/refdb) package: libgit2

procedure

(git_refdb_backend_fs repo)  refdb_backend?

  repo : repository?
Constructors for default filesystem-based refdb backend

Under normal usage, this is called for you when the repository is opened / created, but you can use this to explicitly construct a filesystem refdb backend for a repository.

procedure

(git_refdb_compress refdb)  integer?

  refdb : refdb?
Suggests that the given refdb compress or optimize its references. This mechanism is implementation specific. For on-disk reference databases, for example, this may pack all loose references.

procedure

(git_refdb_free refdb)  void?

  refdb : refdb?
Close an open reference database.

procedure

(git_refdb_init_backend backend version)  integer?

  backend : refdb_backend?
  version : integer?
Initializes a git_refdb_backend with default values. Equivalent to creating an instance with GIT_REFDB_BACKEND_INIT.

procedure

(git_refdb_new repo)  refdb?

  repo : repository?
Create a new reference database with no backends.

Before the Ref DB can be used for read/writing, a custom database backend must be manually set using git_refdb_set_backend()

procedure

(git_refdb_open repo)  refdb?

  repo : repository?
Create a new reference database and automatically add the default backends:

git_refdb_dir: read and write loose and packed refs from disk, assuming the repository dir as the folder

procedure

(git_refdb_set_backend refdb backend)  integer?

  refdb : refdb?
  backend : refdb_backend?
Sets the custom backend to an existing reference DB

The git_refdb will take ownership of the git_refdb_backend so you should NOT free it after calling this function.