X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=rev-parse.c;h=f176c56f7f896df7d955d1f75e01c464f1aefaf0;hb=b0a3de42316a4e8f1d561cbe12b7bb282631a0d6;hp=19a5ef7f48a722c44a3534f281581f9a6ed08e84;hpb=84a9b58c421f9b2d1cc6c195ed441fac48e60392;p=git.git diff --git a/rev-parse.c b/rev-parse.c index 19a5ef7f..f176c56f 100644 --- a/rev-parse.c +++ b/rev-parse.c @@ -172,9 +172,11 @@ int main(int argc, char **argv) struct stat st; char *arg = argv[i]; char *dotdot; - + if (as_is) { - show_file(arg); + if (show_file(arg) && as_is < 2) + if (lstat(arg, &st) < 0) + die("'%s': %s", arg, strerror(errno)); continue; } if (!strcmp(arg,"-n")) { @@ -194,7 +196,7 @@ int main(int argc, char **argv) if (*arg == '-') { if (!strcmp(arg, "--")) { - as_is = 1; + as_is = 2; /* Pass on the "--" if we show anything but files.. */ if (filter & (DO_FLAGS | DO_REVS)) show_file(arg);