summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVicent Martí <vicent@github.com>2012-09-13 09:07:06 -0700
committerVicent Martí <vicent@github.com>2012-09-13 09:07:06 -0700
commit45c4697c48e50951a383f93d63ad0c192915df8c (patch)
treea54b1ad45e5f5bcc10c10a5c2797dda1b4a13625
parent13faa77c57d3fe9ddcfbfdf35c0cdd631521a280 (diff)
parentab8a0402aeac9767e5bb1b022a6c9ad27cf78f32 (diff)
downloadlibgit2-45c4697c48e50951a383f93d63ad0c192915df8c.tar.gz
Merge pull request #928 from barrbrain/odb-pack-stat-less
odb_pack: try lookup before refreshing packs
-rw-r--r--src/odb_pack.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/odb_pack.c b/src/odb_pack.c
index 6e3d3eefd..d33d06456 100644
--- a/src/odb_pack.c
+++ b/src/odb_pack.c
@@ -268,13 +268,13 @@ static int pack_entry_find(struct git_pack_entry *e, struct pack_backend *backen
int error;
unsigned int i;
- if ((error = packfile_refresh_all(backend)) < 0)
- return error;
-
if (backend->last_found &&
git_pack_entry_find(e, backend->last_found, oid, GIT_OID_HEXSZ) == 0)
return 0;
+ if ((error = packfile_refresh_all(backend)) < 0)
+ return error;
+
for (i = 0; i < backend->packs.length; ++i) {
struct git_pack_file *p;