pull --rebase: Avoid spurious conflicts and reapplying unnecessary patches
[gitweb.git] / builtin-rev-parse.c
index d14fe20692aa0903f45da96bf9f31f4564b7816a..a8c5043dedd785b8fc43c0921edd01e2adac65e1 100644 (file)
@@ -604,6 +604,12 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
                                for_each_remote_ref(show_reference, NULL);
                                continue;
                        }
+                       if (!strcmp(arg, "--show-toplevel")) {
+                               const char *work_tree = get_git_work_tree();
+                               if (work_tree)
+                                       puts(work_tree);
+                               continue;
+                       }
                        if (!strcmp(arg, "--show-prefix")) {
                                if (prefix)
                                        puts(prefix);