magit-repolist-column-dirty: fix 801cbfd8
Despite its name, magit-unstaged-files [1] lists both staged and
unstaged changes because it's based on a "git diff-index HEAD" call.
As a result, magit-repolist-column-dirty's last condition in 801cbfd8
is unreachable. Use magit-modified-files instead, which is based on a
"git diff-files" call and is restricted to files with unstaged
changes.
With the above issue fixed, the last condition can be reached, but the
return value for this condition is wrong. Correct the
magit-staged-files call so that "S" is returned rather than passed as
an argument to magit-staged-files.
[1] magit-unstaged-files was added in 65867b5d (magit-unstaged-files:
new function, 2015-12-15) and has never been used for anything
until its use in magit-repolist-column-dirty. I don't know how it
was supposed to differ from magit-modified-files.
Kyle Meyer
7 years ago
194 | 194 | Show S if there is at least one staged file. |
195 | 195 | Only one letter is shown, the first that applies." |
196 | 196 | (cond ((magit-untracked-files) "N") |
197 | ((magit-unstaged-files) "U") | |
198 | ((magit-staged-files "S")))) | |
197 | ((magit-modified-files) "U") | |
198 | ((magit-staged-files) "S"))) | |
199 | 199 | |
200 | 200 | (defun magit-repolist-column-unpulled-from-upstream (_id) |
201 | 201 | "Insert number of upstream commits not in the current branch." |