(code)
| 79 | } |
| 80 | |
| 81 | push(code) { |
| 82 | const changed = $('.diff-file:checked').toArray().map(elem => elem.value); |
| 83 | const changedFiles = changed.filter(f => code.gas[f]).map(f => { |
| 84 | return { |
| 85 | name: f, |
| 86 | content: code.gas[f] |
| 87 | } |
| 88 | }); |
| 89 | const deleteFiles = changed.filter(f => !code.gas[f]); |
| 90 | const newFileNames = changed.filter(f => !code.scm[f]); |
| 91 | const updatedFileNames = changed.filter(f => !newFileNames.includes(f)); |
| 92 | |
| 93 | const newFiles = changedFiles.filter(f => newFileNames.includes(f.name)); |
| 94 | const updatedFiles = changedFiles.filter(f => updatedFileNames.includes(f.name)); |
| 95 | |
| 96 | const comment = $('#commit-comment').val(); |
| 97 | |
| 98 | this.commitFiles(getRepo().fullName, getBranch(), null, newFiles, updatedFiles, deleteFiles, comment) |
| 99 | .then(() => { |
| 100 | showLog(`Successfully push to ${getBranch()} of ${getRepo().fullName}`); |
| 101 | }) |
| 102 | .catch((err) => { |
| 103 | showLog(`Failed to push: ${err}`, LEVEL_ERROR); |
| 104 | }); |
| 105 | } |
| 106 | |
| 107 | getAllBranches() { |
| 108 | let repoId = getRepo().id || this.namesToIds.repos[getRepo().fullName]; |
no test coverage detected