diff options
| author | Shawn O. Pearce <sop@google.com> | 2009-02-02 16:17:02 -0800 |
|---|---|---|
| committer | Shawn O. Pearce <sop@google.com> | 2009-02-02 16:17:02 -0800 |
| commit | a8e98a6962727969da9faa12658596c8b1a14baf (patch) | |
| tree | 4666a12620fdc276f619714a88fc32d73bd49919 /color.py | |
| parent | b54a392c9a267a06058b663377282c9dcec6878e (diff) | |
| download | git-repo-a8e98a6962727969da9faa12658596c8b1a14baf.tar.gz | |
Fix color parsing to not crash when user defined colors are setv1.5.1
We didn't use the right Python string methods to parse colors.
$ git config --global color.status.added yellow
managed to cause a stack trace due to undefined methods trim()
and lowercase(). Instead use strip() and lower().
Signed-off-by: Shawn O. Pearce <sop@google.com>
Diffstat (limited to 'color.py')
| -rw-r--r-- | color.py | 2 |
1 files changed, 1 insertions, 1 deletions
| @@ -137,7 +137,7 @@ class Coloring(object): | |||
| 137 | if v is None: | 137 | if v is None: |
| 138 | return _Color(fg, bg, attr) | 138 | return _Color(fg, bg, attr) |
| 139 | 139 | ||
| 140 | v = v.trim().lowercase() | 140 | v = v.strip().lower() |
| 141 | if v == "reset": | 141 | if v == "reset": |
| 142 | return RESET | 142 | return RESET |
| 143 | elif v == '': | 143 | elif v == '': |
