Use git attributes to determine generated and vendored status for language stats and diffs (#16773)
Replaces #16262 Replaces #16250 Replaces #14833 This PR first implements a `git check-attr` pipe reader - using `git check-attr --stdin -z --cached` - taking account of the change in the output format in git 1.8.5 and creates a helper function to read a tree into a temporary index file for that pipe reader. It then wires this in to the language stats helper and into the git diff generation. Files which are marked generated will be folded by default. Fixes #14786 Fixes #12653
This commit is contained in:
parent
b83b4fbef9
commit
248b96d8a3
10 changed files with 736 additions and 17 deletions
|
@ -2349,8 +2349,9 @@ function initCodeView() {
|
|||
}
|
||||
$(document).on('click', '.fold-file', ({currentTarget}) => {
|
||||
const box = currentTarget.closest('.file-content');
|
||||
const chevron = currentTarget.querySelector('a.chevron');
|
||||
const folded = box.dataset.folded !== 'true';
|
||||
currentTarget.innerHTML = svg(`octicon-chevron-${folded ? 'right' : 'down'}`, 18);
|
||||
chevron.innerHTML = svg(`octicon-chevron-${folded ? 'right' : 'down'}`, 18);
|
||||
box.dataset.folded = String(folded);
|
||||
});
|
||||
$(document).on('click', '.blob-excerpt', async ({currentTarget}) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue