X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;ds=sidebyside;f=diff-no-index.c;h=598687b50ac7b88ca0860faf1670d03047bb3603;hb=7ee3760e2c8f181f22d4b80afc03309e4f764385;hp=60ed17470a6a2bf9bea202a04004b06d207a77d7;hpb=8c4c286c394cc383577bf884f37a708bba98549e;p=git.git diff --git a/diff-no-index.c b/diff-no-index.c index 60ed17470..598687b50 100644 --- a/diff-no-index.c +++ b/diff-no-index.c @@ -38,9 +38,13 @@ static int get_mode(const char *path, int *mode) if (!path || !strcmp(path, "/dev/null")) *mode = 0; +#ifdef _WIN32 + else if (!strcasecmp(path, "nul")) + *mode = 0; +#endif else if (!strcmp(path, "-")) *mode = create_ce_mode(0666); - else if (stat(path, &st)) + else if (lstat(path, &st)) return error("Could not access '%s'", path); else *mode = st.st_mode; @@ -247,6 +251,7 @@ void diff_no_index(struct rev_info *revs, else revs->diffopt.paths = argv + argc - 2; revs->diffopt.nr_paths = 2; + revs->diffopt.skip_stat_unmatch = 1; DIFF_OPT_SET(&revs->diffopt, EXIT_WITH_STATUS); DIFF_OPT_SET(&revs->diffopt, NO_INDEX);