return stripWhitespaceFromFile(fileObj.file, clearWholeFile).then(function () { // stage the files again to include stripWhitespace changes return Git.stage(fileObj.file).then(function () { var t = (new Date()).getTime() - startTime; notificationDefer.progress(t + "ms - " + Strings.CLEAN_FILE_END + ": " + fileObj.file); }); });
.then(function () { var currentProjectRoot = Utils.getProjectRoot(); var currentDoc = DocumentManager.getCurrentDocument(); if (currentDoc) { var relativePath = currentDoc.file.fullPath.substring(currentProjectRoot.length); return Git.stage(relativePath).then(function () { return handleGitCommit(); }); } });
.on("click", ".check-one", function (e) { e.stopPropagation(); var $tr = $(this).closest("tr"), file = $tr.attr("x-file"), status = $tr.attr("x-status"), isChecked = $(this).is(":checked"); if (e.shiftKey) { // stage/unstage all file between var lc = lastCheckOneClicked.localeCompare(file), lcClickedSelector = "[x-file='" + lastCheckOneClicked + "']", sequence; if (lc < 0) { sequence = $tr.prevUntil(lcClickedSelector).andSelf(); } else if (lc > 0) { sequence = $tr.nextUntil(lcClickedSelector).andSelf(); } if (sequence) { sequence = sequence.add($tr.parent().children(lcClickedSelector)); var promises = sequence.map(function () { var $this = $(this), method = isChecked ? "stage" : "unstage", file = $this.attr("x-file"), status = $this.attr("x-status"); return Git[method](file, status === Git.FILE_STATUS.DELETED); }).toArray(); return Promise.all(promises).then(function () { return Git.status(); }).catch(function (err) { ErrorHandler.showError(err, "Modifying file status failed"); }); } } lastCheckOneClicked = file; if (isChecked) { Git.stage(file, status === Git.FILE_STATUS.DELETED).then(function () { Git.status(); }); } else { Git.unstage(file).then(function () { Git.status(); }); } })
return createGitIgnore().then(function () { return Git.stage(".gitignore"); }).then(function () {