提交 482a6c10 编写于 作者: M Michael J Gruber 提交者: Junio C Hamano

status -s: respect the status.relativePaths option

Otherwise, 'status' and 'status -s' in a subdir would produce different
names.  This change is all the more important because status.relativePaths
is on by default.
Signed-off-by: NMichael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 46b77a6b
...@@ -114,8 +114,8 @@ compatibility) and `color.status.<slot>` configuration variables ...@@ -114,8 +114,8 @@ compatibility) and `color.status.<slot>` configuration variables
to colorize its output. to colorize its output.
If the config variable `status.relativePaths` is set to false, then all If the config variable `status.relativePaths` is set to false, then all
paths shown in the long format are relative to the repository root, not paths shown are relative to the repository root, not to the current
to the current directory. directory.
If `status.submodulesummary` is set to a non zero number or true (identical If `status.submodulesummary` is set to a non zero number or true (identical
to -1 or an unlimited number), the submodule summary will be enabled for to -1 or an unlimited number), the submodule summary will be enabled for
......
...@@ -1059,6 +1059,8 @@ int cmd_status(int argc, const char **argv, const char *prefix) ...@@ -1059,6 +1059,8 @@ int cmd_status(int argc, const char **argv, const char *prefix)
switch (status_format) { switch (status_format) {
case STATUS_FORMAT_SHORT: case STATUS_FORMAT_SHORT:
if (s.relative_paths)
s.prefix = prefix;
short_print(&s, null_termination); short_print(&s, null_termination);
break; break;
case STATUS_FORMAT_PORCELAIN: case STATUS_FORMAT_PORCELAIN:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册