diff options
| author | Vicent Marti <tanoku@gmail.com> | 2012-11-28 10:47:10 +0100 |
|---|---|---|
| committer | Vicent Marti <tanoku@gmail.com> | 2012-11-28 10:47:10 +0100 |
| commit | 9507a434c6a1e70ccd8a2678fe35b092105be1db (patch) | |
| tree | 73f8b9464e513337589a982ddfa54beb4bd677ea /src/odb.c | |
| parent | 64c5112188647fcbfbe2bbfb897abfbc21912ba8 (diff) | |
| download | libgit2-9507a434c6a1e70ccd8a2678fe35b092105be1db.tar.gz | |
odb: Add `git_odb_add_disk_alternate`
Loads a disk alternate by path to the ODB. Mimics the
`GIT_ALTERNATE_OBJECT_DIRECTORIES` shell var.
Diffstat (limited to 'src/odb.c')
| -rw-r--r-- | src/odb.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -470,6 +470,11 @@ static int load_alternates(git_odb *odb, const char *objects_dir, int alternate_ return result; } +int git_odb_add_disk_alternate(git_odb *odb, const char *path) +{ + return add_default_backends(odb, path, 1, 0); +} + int git_odb_open(git_odb **out, const char *objects_dir) { git_odb *db; @@ -481,8 +486,7 @@ int git_odb_open(git_odb **out, const char *objects_dir) if (git_odb_new(&db) < 0) return -1; - if (add_default_backends(db, objects_dir, 0, 0) < 0) - { + if (add_default_backends(db, objects_dir, 0, 0) < 0) { git_odb_free(db); return -1; } |
