コード例 #1
0
ファイル: Utils.js プロジェクト: andyearnshaw/brackets-git
                        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);
                            });
                        });
コード例 #2
0
ファイル: Panel.js プロジェクト: FezVrasta/brackets-git
 .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();
         });
     }
 });
コード例 #3
0
ファイル: Panel.js プロジェクト: FezVrasta/brackets-git
            .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();
                    });
                }
            })
コード例 #4
0
ファイル: NoRepo.js プロジェクト: Azakur4/brackets-git
 return createGitIgnore().then(function () {
     return Git.stage(".gitignore");
 }).then(function () {