Skip to content

Commit

Permalink
indexer: don't look for the index we're creating
Browse files Browse the repository at this point in the history
When creating an index, know that we do not have an index for
our own packfile, preventing some unnecessary file opens and
error reporting.
  • Loading branch information
Edward Thomson authored and carlosmn committed Jun 22, 2015
1 parent 6ba8a33 commit 76af4ff
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/pack.c
Expand Up @@ -951,8 +951,15 @@ git_off_t get_delta_base(
if (k != kh_end(p->idx_cache)) {
*curpos += 20;
return ((struct git_pack_entry *)kh_value(p->idx_cache, k))->offset;
} else {
/* If we're building an index, don't try to find the pack
* entry; we just haven't seen it yet. We'll make
* progress again in the next loop.
*/
return GIT_PASSTHROUGH;
}
}

/* The base entry _must_ be in the same pack */
if (pack_entry_find_offset(&base_offset, &unused, p, (git_oid *)base_info, GIT_OID_HEXSZ) < 0)
return packfile_error("base entry delta is not in the same pack");
Expand Down

0 comments on commit 76af4ff

Please sign in to comment.