X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=rev-parse.c;h=f176c56f7f896df7d955d1f75e01c464f1aefaf0;hb=9181ca2c2b1f2897baa67ff8e48b1984822115b5;hp=f90e999e607d238fbfe17e84f286570c04844100;hpb=09a278e6b906d3902f3b75ec183a06b0c029d27b;p=git.git diff --git a/rev-parse.c b/rev-parse.c index f90e999e..f176c56f 100644 --- a/rev-parse.c +++ b/rev-parse.c @@ -166,13 +166,17 @@ int main(int argc, char **argv) unsigned char sha1[20]; const char *prefix = setup_git_directory(); + git_config(git_default_config); + for (i = 1; i < argc; i++) { 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")) { @@ -192,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);