• Yorick Peterse's avatar
    Use File.exist? to check if a repository exists · 6f393877
    Yorick Peterse authored
    Initializing Rugged objects is way too expensive just to check if a
    repository exists. Even though we cache this data once in a while we
    have to refresh this. On GitLab.com we have seen Repository#exists?
    taking up to _1 minute_ to complete in the absolute worst case, though
    usually it sits around a second or so.
    
    Using File.exist? to instead check if $GIT_DIR/refs exists is a much
    faster way of checking if a repository was initialized properly.
    6f393877
repository.rb 30.2 KB