use of com.oxygenxml.git.service.NoRepositorySelected in project oxygen-git-client-addon by oxygenxml.
the class CurrentBranchRemotesDialog method doOK.
@Override
protected void doOK() {
RemoteBranchItem currentSelectedBranch = (RemoteBranchItem) remoteBranchItems.getSelectedItem();
if (!currentSelectedBranch.isUndefined() && !currentSelectedBranch.isFirstSelection()) {
try {
BranchConfigurations branchConfig = new BranchConfigurations(GitAccess.getInstance().getRepository().getConfig(), currentBranch);
branchConfig.setRemote(currentSelectedBranch.remote);
branchConfig.setMerge(currentSelectedBranch.branch);
GitAccess.getInstance().updateConfigFile();
} catch (NoRepositorySelected e) {
LOGGER.error(e.getMessage(), e);
}
}
super.doOK();
}
use of com.oxygenxml.git.service.NoRepositorySelected in project oxygen-git-client-addon by oxygenxml.
the class DiffPresenter method diffViewForAddedAndUntracked.
/**
* Diff for added/untracked resources.
*
* @param fileStatus File to compare.
*/
private static void diffViewForAddedAndUntracked(FileStatus fileStatus) {
URL url = null;
try {
GitChangeType changeType = fileStatus.getChangeType();
if (changeType == GitChangeType.ADD) {
url = GitRevisionURLHandler.encodeURL(VersionIdentifier.INDEX_OR_LAST_COMMIT, fileStatus.getFileLocation());
} else {
url = FileUtil.getFileURL(fileStatus.getFileLocation());
}
} catch (MalformedURLException | NoRepositorySelected e) {
// Shouldn't rreally happen
if (LOGGER.isDebugEnabled()) {
LOGGER.debug(e.getMessage(), e);
}
}
showDiffFrame(url, null, null, fileStatus.getFileLocation());
}
use of com.oxygenxml.git.service.NoRepositorySelected in project oxygen-git-client-addon by oxygenxml.
the class RepoGenerationScript method setUserCredentials.
public static void setUserCredentials() {
try {
StoredConfig config = GitAccess.getInstance().getRepository().getConfig();
config.setString("user", null, "name", "AlexJitianu");
config.setString("user", null, "email", "alex_jitianu@sync.ro");
config.save();
} catch (NoRepositorySelected | IOException e) {
e.printStackTrace();
}
}
Aggregations