Skip to content
  • Linus Torvalds's avatar
    Add 'df_name_compare()' helper function · 0ab9e1e8
    Linus Torvalds authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    This new helper is identical to base_name_compare(), except it compares
    conflicting directory/file entries as equal in order to help handling DF
    conflicts (thus the name).
    
    Note that while a directory name compares as equal to a regular file
    with the new helper, they then individually compare _differently_ to a
    filename that has a dot after the basename (because '\0' < '.' < '/').
    
    So a directory called "foo/" will compare equal to a file "foo", even
    though "foo.c" will compare after "foo" and before "foo/"
    
    This will be used by routines that want to traverse the git namespace
    but then handle conflicting entries together when possible.
    
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    0ab9e1e8