MCPcopy
hub / github.com/leonhartX/gas-github / push

Method push

src/scm/gitlab.js:81–105  ·  view source on GitHub ↗
(code)

Source from the content-addressed store, hash-verified

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];

Callers 15

cFunction · 0.45
oFunction · 0.45
aFunction · 0.45
pFunction · 0.45
highlight.min.jsFile · 0.45
convertChangesToDMPFunction · 0.45
convertChangesToXMLFunction · 0.45
diff2html.min.jsFile · 0.45
canonicalizeFunction · 0.45
applyPatchFunction · 0.45
structuredPatchFunction · 0.45

Calls 4

commitFilesMethod · 0.95
getRepoFunction · 0.85
getBranchFunction · 0.85
showLogFunction · 0.85

Tested by

no test coverage detected