.then(function (userName) { if (!userName.length) { userName = currentUserName; } return Git.setConfig("user.name", userName).catch(function (err) { ErrorHandler.showError(err, "Impossible change username"); }).then(function () { EventEmitter.emit(Events.GIT_USERNAME_CHANGED, userName); }); });
.then(function (userEmail) { if (!userEmail.length) { userEmail = currentUserEmail; } return Git.setConfig("user.email", userEmail).catch(function (err) { ErrorHandler.showError(err, "Impossible change user email"); }).then(function () { EventEmitter.emit(Events.GIT_EMAIL_CHANGED, userEmail); }); });
return Git.push(remoteUrl, branchHash).then(function (pushResponse) { if (shouldSave) { return Git.setConfig("remote." + remoteName + ".url", remoteUrl).then(function () { return pushResponse; }); } return pushResponse; });