Skip to content

Commit

Permalink
status -s: respect the status.relativePaths option
Browse files Browse the repository at this point in the history
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: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Michael J Gruber authored and Junio C Hamano committed Nov 27, 2009
1 parent 46b77a6 commit 482a6c1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Documentation/git-status.txt
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ compatibility) and `color.status.<slot>` configuration variables
to colorize its output.

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
to the current directory.
paths shown are relative to the repository root, not to the current
directory.

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
Expand Down
2 changes: 2 additions & 0 deletions builtin-commit.c
Original file line number Diff line number Diff line change
Expand Up @@ -1059,6 +1059,8 @@ int cmd_status(int argc, const char **argv, const char *prefix)

switch (status_format) {
case STATUS_FORMAT_SHORT:
if (s.relative_paths)
s.prefix = prefix;
short_print(&s, null_termination);
break;
case STATUS_FORMAT_PORCELAIN:
Expand Down

0 comments on commit 482a6c1

Please sign in to comment.