Skip to content
  • Johannes Schindelin's avatar
    get_oid(): when an object was not found, try harder · 6d67a993
    Johannes Schindelin authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    It is quite possible that the loose object cache gets stale when new
    objects are written. In that case, get_oid() would potentially say that
    it cannot find a given object, even if it should find it.
    
    Let's blow away the loose object cache as well as the read packs and try
    again in that case.
    
    Note: this does *not* affect the code path that was introduced to help
    avoid looking for the same non-existing objects (which made some
    operations really expensive via NFS): that code path is handled by the
    `OBJECT_INFO_QUICK` flag (which does not even apply to `get_oid()`,
    which has no equivalent flag, at least at the time this patch was
    written).
    
    This incidentally fixes the problem identified earlier where an
    interactive rebase wanted to re-read (and validate) the todo list after
    an `exec` command modified it.
    
    Helped-by: default avatarJeff King <peff@peff.net>
    Signed-off-by: default avatarJohannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    6d67a993