Skip to content
  • brian m. carlson's avatar
    gitweb: make hash size independent · cfb04911
    brian m. carlson authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    Gitweb has several hard-coded 40 values throughout it to check for
    values that are passed in or acquired from Git.  To simplify the code,
    introduce a regex variable that matches either exactly 40 or exactly 64
    hex characters, and use this variable anywhere we would have previously
    hard-coded a 40 in a regex.
    
    Add some helper functions which allow us to write tighter regexes that
    match exactly the number of hex characters we're expecting.
    
    Similarly, switch the code that looks for deleted diffinfo information
    to look for either 40 or 64 zeros, and update one piece of code to use
    this function.  Finally, when formatting a log line, allow an
    abbreviated describe output to contain up to 64 characters.
    
    Helped-by: default avatarÆvar Arnfjörð Bjarmason <avarab@gmail.com>
    Signed-off-by: default avatarbrian m. carlson <sandals@crustytoothpaste.net>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    cfb04911