teach git-status about spaces in filenames
git-status truncates filenames up to the first occurrence of a whitespace character when displaying. More precisely, it displays the filename up to any field seperator defined in $IFS. This patch fixes it. Signed-off-by: Junio C Hamano <junkio@cox.net>
Kai Ruemmler committed
Oct 7, 2005 at 16:55 UTC
33bb218e9d7299f6ed06177c65d357ec81954ca9
1 file changed
+21
-3
git-status.sh
+21
-3
@@ -42,7 +42,15 @@ git-update-index -q --unmerged --refresh || exit
42
if GIT_DIR="$GIT_DIR" git-rev-parse --verify HEAD >/dev/null 2>&1
43
then
44
git-diff-index -M --cached HEAD |
45
- sed 's/^://' |
45
+ sed -e '
46
+ s/^://
47
+ h
48
+ s/^[^\t]*//
49
+ s/ /\\ /g
50
+ x
51
+ s/\t.*$//
52
+ G
53
+ s/\n/ /' |
54
report "Updated but not checked in" "will commit"
55
56
committable="$?"
@@ -51,14 +59,24 @@ else
59
# Initial commit
60
#'
61
git-ls-files |
54
- sed 's/^/o o o o A /' |
62
+ sed -e '
63
+ s/ /\\ /g
64
+ s/^/o o o o A /' |
65
report "Updated but not checked in" "will commit"
66
67
committable="$?"
68
fi
69
70
git-diff-files |
61
-sed 's/^://' |
71
+sed -e '
72
+ s/^://
73
+ h
74
+ s/^[^\t]*//
75
+ s/ /\\ /g
76
+ x
77
+ s/\t.*$//
78
+ G
79
+ s/\n/ /' |
80
report "Changed but not updated" "use git-update-index to mark for commit"
81
82
if grep -v '^#' "$GIT_DIR/info/exclude" >/dev/null 2>&1