diff options
| author | Carlos Martín Nieto <cmn@dwim.me> | 2016-03-10 22:01:09 +0100 |
|---|---|---|
| committer | Carlos Martín Nieto <cmn@dwim.me> | 2016-11-14 11:35:38 +0100 |
| commit | ce5553d48b8ba3510dd5032dfbfd161fb801cd77 (patch) | |
| tree | 0d8cd5183cc431db35de00cc1b236b807183dea5 /src/refdb.c | |
| parent | 7c32d874503ee43206cb5d2a8e65dbe23f18eaca (diff) | |
| download | libgit2-ce5553d48b8ba3510dd5032dfbfd161fb801cd77.tar.gz | |
refdb: bubble up locked files on the read side
On Windows we can find locked files even when reading a reference or the
packed-refs file. Bubble up the error in this case as well to allow
callers on Windows to retry more intelligently.
Diffstat (limited to 'src/refdb.c')
| -rw-r--r-- | src/refdb.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/refdb.c b/src/refdb.c index debba1276..85c84892b 100644 --- a/src/refdb.c +++ b/src/refdb.c @@ -125,13 +125,15 @@ int git_refdb_lookup(git_reference **out, git_refdb *db, const char *ref_name) int git_refdb_iterator(git_reference_iterator **out, git_refdb *db, const char *glob) { + int error; + if (!db->backend || !db->backend->iterator) { giterr_set(GITERR_REFERENCE, "This backend doesn't support iterators"); return -1; } - if (db->backend->iterator(out, db->backend, glob) < 0) - return -1; + if ((error = db->backend->iterator(out, db->backend, glob)) < 0) + return error; GIT_REFCOUNT_INC(db); (*out)->db = db; |
