Skip to content
  • Jeff King's avatar
    add: use separate ADD_CACHE_RENORMALIZE flag · 9e5da3d0
    Jeff King authored and Junio C Hamano's avatar Junio C Hamano committed
    Commit 9472935d
    
     (add: introduce "--renormalize", 2017-11-16) taught
    git-add to pass HASH_RENORMALIZE to add_to_index(), which then passes
    the flag along to index_path(). However, the flags taken by
    add_to_index() and the ones taken by index_path() are distinct
    namespaces. We cannot take HASH_* flags in add_to_index(), because they
    overlap with the ADD_CACHE_* flags we already take (in this case,
    HASH_RENORMALIZE conflicts with ADD_CACHE_IGNORE_ERRORS).
    
    We can solve this by adding a new ADD_CACHE_RENORMALIZE flag, and using
    it to set HASH_RENORMALIZE within add_to_index(). In order to make it
    clear that these two flags come from distinct sets, let's also change
    the name "newflags" in the function to "hash_flags".
    
    Reported-by: default avatarDmitriy Smirnov <dmitriy.smirnov@jetbrains.com>
    Signed-off-by: default avatarJeff King <peff@peff.net>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    9e5da3d0