Codebase list magit / 991aa24
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
1 changed file(s) with 2 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
194194 Show S if there is at least one staged file.
195195 Only one letter is shown, the first that applies."
196196 (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")))
199199
200200 (defun magit-repolist-column-unpulled-from-upstream (_id)
201201 "Insert number of upstream commits not in the current branch."