• J
    stat() for existence in safe_create_leading_directories() · 67d42212
    Jason Riedy 提交于
    Use stat() to explicitly check for existence rather than
    relying on the non-portable EEXIST error in sha1_file.c's
    safe_create_leading_directories().  There certainly are
    optimizations possible, but then the code becomes almost
    the same as that in coreutil's lib/mkdir-p.c.
    
    Other uses of EEXIST seem ok.  Tested on Solaris 8, AIX 5.2L,
    and a few Linux versions.  AIX has some unrelated (I think)
    failures right now; I haven't tried many recent gits there.
    Anyone have an old Ultrix box to break everything?  ;)
    
    Also remove extraneous #includes.  Everything's already in
    git-compat-util.h, included through cache.h.
    Signed-off-by: NJason Riedy <ejr@cs.berkeley.edu>
    Signed-off-by: NJunio C Hamano <junkio@cox.net>
    67d42212
sha1_file.c 36.9 KB