Skip to content
  • Junio C Hamano's avatar
    diff-no-index: DWIM "diff D F" into "diff D/F F" · c9e1f2c7
    Junio C Hamano authored
    
    
    "git diff --no-index" was supposed to be a poor-man's approach to
    allow using Git diff goodies outside of a Git repository, without
    having to patch mainstream diff implementations.
    
    Unlike a POSIX diff that treats "diff D F" (or "diff F D") as a
    request to compare D/F and F (or F and D/F) when D is a directory
    and F is a file, however, we did not accept such a command line and
    instead barfed with "file/directory conflict".
    
    Imitate what POSIX diff does and append the basename of the file
    after the name of the directory before comparing.
    
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    c9e1f2c7