Sync with 1.7.11.4
[gitweb.git] / builtin / rev-parse.c
index d85b8a6a6d0c14ac992ef9e3c4aee7490c34e76f..32788a9f86427237d0f4838362c1e3bc722fa258 100644 (file)
@@ -492,7 +492,7 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
 
                if (as_is) {
                        if (show_file(arg) && as_is < 2)
-                               verify_filename(prefix, arg);
+                               verify_filename(prefix, arg, 0);
                        continue;
                }
                if (!strcmp(arg,"-n")) {
@@ -644,6 +644,8 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
                        if (!strcmp(arg, "--show-prefix")) {
                                if (prefix)
                                        puts(prefix);
+                               else
+                                       putchar('\n');
                                continue;
                        }
                        if (!strcmp(arg, "--show-cdup")) {
@@ -742,7 +744,7 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
                as_is = 1;
                if (!show_file(arg))
                        continue;
-               verify_filename(prefix, arg);
+               verify_filename(prefix, arg, 1);
        }
        if (verify) {
                if (revs_count == 1) {