Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
)
public class ContextMenuGroup extends GitMenu {
public ContextMenuGroup() {
getTemplatePresentation().setTextValue(GitLocalize.groupContextMenuText());
getTemplatePresentation().setText(GitLocalize.groupContextMenuText());
setPopup(true);
}
}
2 changes: 1 addition & 1 deletion plugin/src/main/java/consulo/git/action/VcsMenuGroup.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
)
public class VcsMenuGroup extends GitMenu {
public VcsMenuGroup() {
getTemplatePresentation().setTextValue(GitLocalize.groupVcsMenuText());
getTemplatePresentation().setText(GitLocalize.groupVcsMenuText());
setPopup(true);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
@ActionImpl(id = "Git.CheckoutRevision")
public class GitCheckoutRevisionAction extends GitLogSingleCommitAction {
public GitCheckoutRevisionAction() {
getTemplatePresentation().setTextValue(GitLocalize.actionCheckoutRevisionText());
getTemplatePresentation().setText(GitLocalize.actionCheckoutRevisionText());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import consulo.annotation.component.ActionImpl;
import consulo.git.localize.GitLocalize;
import consulo.localize.LocalizeValue;
import consulo.project.Project;
import consulo.versionControlSystem.FilePath;
import consulo.versionControlSystem.VcsException;
Expand All @@ -43,7 +42,7 @@
@ActionImpl(id = "Git.CompareWithBranch")
public class GitCompareWithBranchAction extends DvcsCompareWithBranchAction<GitRepository> {
public GitCompareWithBranchAction() {
getTemplatePresentation().setTextValue(GitLocalize.actionCompareWithBranchText());
getTemplatePresentation().setText(GitLocalize.actionCompareWithBranchText());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
*/
package git4idea.actions;

import java.util.Collections;

import consulo.annotation.component.ActionImpl;
import consulo.git.localize.GitLocalize;
import consulo.project.Project;
Expand All @@ -27,11 +25,13 @@
import git4idea.repo.GitRepository;
import jakarta.annotation.Nonnull;

import java.util.Collections;

@ActionImpl(id = "Git.CreateNewBranch")
public class GitCreateNewBranchAction extends GitLogSingleCommitAction {
public GitCreateNewBranchAction() {
getTemplatePresentation().setTextValue(GitLocalize.actionCreateNewBranchText());
getTemplatePresentation().setDescriptionValue(GitLocalize.actionCreateNewBranchDescription());
getTemplatePresentation().setText(GitLocalize.actionCreateNewBranchText());
getTemplatePresentation().setDescription(GitLocalize.actionCreateNewBranchDescription());
}

@Override
Expand Down
6 changes: 3 additions & 3 deletions plugin/src/main/java/git4idea/actions/GitCreateTagAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@
import consulo.annotation.component.ActionImpl;
import consulo.git.localize.GitLocalize;
import consulo.ui.annotation.RequiredUIAccess;
import jakarta.annotation.Nonnull;
import consulo.versionControlSystem.log.Hash;
import git4idea.history.wholeTree.GitCreateNewTag;
import git4idea.repo.GitRepository;
import jakarta.annotation.Nonnull;

@ActionImpl(id = "Git.CreateNewTag")
public class GitCreateTagAction extends GitLogSingleCommitAction {
public GitCreateTagAction() {
getTemplatePresentation().setTextValue(GitLocalize.actionCreateNewTagText());
getTemplatePresentation().setDescriptionValue(GitLocalize.actionCreateNewTagDescription());
getTemplatePresentation().setText(GitLocalize.actionCreateNewTagText());
getTemplatePresentation().setDescription(GitLocalize.actionCreateNewTagDescription());
}

@Override
Expand Down
11 changes: 5 additions & 6 deletions plugin/src/main/java/git4idea/actions/GitFileActionGroup.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@
import consulo.application.dumb.DumbAware;
import consulo.codeEditor.Editor;
import consulo.git.action.FileActionsGroup;
import consulo.ui.ex.action.DefaultActionGroup;
import consulo.virtualFileSystem.VirtualFile;
import consulo.util.collection.JBIterable;
import consulo.git.localize.GitLocalize;
import consulo.ui.annotation.RequiredUIAccess;
import consulo.ui.ex.action.AnActionEvent;
import consulo.ui.ex.action.DefaultActionGroup;
import consulo.ui.ex.action.Presentation;

import consulo.util.collection.JBIterable;
import consulo.virtualFileSystem.VirtualFile;
import jakarta.annotation.Nonnull;

import java.util.Arrays;
Expand Down Expand Up @@ -42,10 +41,10 @@ public void update(@Nonnull AnActionEvent e) {

if (e.getData(Editor.KEY) == null && !selection.isEmpty()) {
if (selection.get(0).isDirectory()) {
presentation.setTextValue(GitLocalize.actionSelectedDirectoryText(selection.size()));
presentation.setText(GitLocalize.actionSelectedDirectoryText(selection.size()));
}
else {
presentation.setTextValue(GitLocalize.actionSelectedFileText(selection.size()));
presentation.setText(GitLocalize.actionSelectedFileText(selection.size()));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public FileAnnotation annotate(@Nonnull final VirtualFile file, final VcsFileRev
final FilePath currentFilePath = VcsUtil.getFilePath(file.getPath());
final FilePath realFilePath;
if (progress != null) {
progress.setTextValue(GitLocalize.gettingHistory(file.getName()));
progress.setText(GitLocalize.gettingHistory(file.getName()));
}
final List<VcsFileRevision> revisions = GitHistoryUtils.history(myProject, currentFilePath);
if (revision == null) {
Expand All @@ -120,7 +120,7 @@ public FileAnnotation annotate(@Nonnull final VirtualFile file, final VcsFileRev
realFilePath = ((GitFileRevision)revision).getPath();
}
if (progress != null) {
progress.setTextValue(GitLocalize.computingAnnotation(file.getName()));
progress.setText(GitLocalize.computingAnnotation(file.getName()));
}
final GitFileAnnotation result = annotate(realFilePath, revision, revisions, file);
annotation[0] = result;
Expand Down
4 changes: 2 additions & 2 deletions plugin/src/main/java/git4idea/commands/GitHandlerUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,12 @@ public static void runInCurrentThread(
handler,
() -> {
if (indicator != null) {
indicator.setTextValue(
indicator.setText(
operationName.isEmpty()
? GitLocalize.gitRunning(handler.printableCommandLine())
: operationName
);
indicator.setText2Value(LocalizeValue.empty());
indicator.setText2(LocalizeValue.empty());
if (setIndeterminateFlag) {
indicator.setIndeterminate(true);
}
Expand Down
4 changes: 2 additions & 2 deletions plugin/src/main/java/git4idea/commands/GitTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -313,9 +313,9 @@ public final void runAlone() {
@RequiredUIAccess
private void justRun() {
LocalizeValue oldTitle = myProgressIndicator.getTextValue();
myProgressIndicator.setTextValue(myTitle);
myProgressIndicator.setText(myTitle);
myDelegate.run(myProgressIndicator);
myProgressIndicator.setTextValue(oldTitle);
myProgressIndicator.setText(oldTitle);
if (myProgressIndicator.isCanceled()) {
onCancel();
}
Expand Down
2 changes: 1 addition & 1 deletion plugin/src/main/java/git4idea/reset/GitResetAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
@ActionImpl(id = "Git.Reset.In.Log")
public class GitResetAction extends GitOneCommitPerRepoLogAction {
public GitResetAction() {
getTemplatePresentation().setTextValue(GitLocalize.actionLogResetText());
getTemplatePresentation().setText(GitLocalize.actionLogResetText());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ protected void save(@Nonnull Collection<VirtualFile> rootsToSave) throws VcsExce
new LocalChangesUnderRoots(myChangeManager, myVcsManager).getChangesByLists(rootsToSave);

LocalizeValue oldProgressTitle = myProgressIndicator.getTextValue();
myProgressIndicator.setTextValue(GitLocalize.updateShelvingChanges());
myProgressIndicator.setText(GitLocalize.updateShelvingChanges());
List<VcsException> exceptions = new ArrayList<>(1);
myShelvedLists = new HashMap<>();

Expand Down Expand Up @@ -91,7 +91,7 @@ protected void save(@Nonnull Collection<VirtualFile> rootsToSave) throws VcsExce
GitRollbackEnvironment.resetHardLocal(myProject, root);
}
}
myProgressIndicator.setTextValue(oldProgressTitle);
myProgressIndicator.setText(oldProgressTitle);
}

@Override
Expand All @@ -100,7 +100,7 @@ public void load() {
if (myShelvedLists != null) {
LOG.info("load ");
LocalizeValue oldProgressTitle = myProgressIndicator.getTextValue();
myProgressIndicator.setTextValue(GitLocalize.updateUnshelvingChanges());
myProgressIndicator.setText(GitLocalize.updateUnshelvingChanges());
for (ShelvedChangeList list : myShelvedLists.values()) {
GitShelveUtils.doSystemUnshelve(
myProject,
Expand All @@ -110,7 +110,7 @@ public void load() {
getConflictRightPanelTitle()
);
}
myProgressIndicator.setTextValue(oldProgressTitle);
myProgressIndicator.setText(oldProgressTitle);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ protected void save(@Nonnull Collection<VirtualFile> rootsToSave) throws VcsExce
}
}
}
myProgressIndicator.setTextValue(oldProgressTitle);
myProgressIndicator.setText(oldProgressTitle);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ public void update(@Nonnull AnActionEvent e) {
boolean isFresh = ContainerUtil.and(myRepositories, Repository::isFresh);
if (isFresh) {
e.getPresentation().setEnabled(false);
e.getPresentation().setDescriptionValue(GitBranchesLocalize.actionCheckoutTagOrRevisionImpossibleDescription());
e.getPresentation().setDescription(GitBranchesLocalize.actionCheckoutTagOrRevisionImpossibleDescription());
}
}
}
Expand Down Expand Up @@ -210,7 +210,7 @@ protected AbstractBranchActions(
myGitBranchManager = project.getInstance(GitBranchManager.class);

getTemplatePresentation().setDisabledMnemonic(true);
getTemplatePresentation().setTextValue(LocalizeValue.of(branchName));
getTemplatePresentation().setText(LocalizeValue.of(branchName));
}

protected class CompareAction extends DumbAwareAction {
Expand Down
4 changes: 2 additions & 2 deletions plugin/src/main/java/git4idea/update/GitMergeUpdater.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ protected GitUpdateResult doUpdate() {
new GitUntrackedFilesOverwrittenByOperationDetector(myRoot);

LocalizeValue originalText = myProgressIndicator.getTextValue();
myProgressIndicator.setTextValue(LocalizeValue.localizeTODO("Merging" + GitUtil.mention(myRepository) + "..."));
myProgressIndicator.setText(LocalizeValue.localizeTODO("Merging" + GitUtil.mention(myRepository) + "..."));
try {
Comment on lines 89 to 91
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The progress indicator text is restored only on the success/failure path inside the try block. If ProcessCanceledException is thrown, the method returns without resetting the text to originalText, which can leave stale "Merging..." in the UI if the indicator is reused. Consider restoring originalText in a finally block (or in the cancel path) before returning.

Copilot uses AI. Check for mistakes.
GitCommandResult result = myGit.merge(
myRepository,
Expand All @@ -97,7 +97,7 @@ protected GitUpdateResult doUpdate() {
untrackedFilesDetector,
GitStandardProgressAnalyzer.createListener(myProgressIndicator)
);
myProgressIndicator.setTextValue(originalText);
myProgressIndicator.setText(originalText);
return result.success()
? GitUpdateResult.SUCCESS
: handleMergeFailure(mergeLineListener, untrackedFilesDetector, merger, result.getErrorOutputAsJoinedValue());
Expand Down
4 changes: 2 additions & 2 deletions plugin/src/main/java/git4idea/update/GitUpdateProcess.java
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public GitUpdateProcess(
public GitUpdateResult update(UpdateMethod updateMethod) {
LOG.info("update started|" + updateMethod);
LocalizeValue oldText = myProgressIndicator.getTextValue();
myProgressIndicator.setTextValue(LocalizeValue.localizeTODO("Updating..."));
myProgressIndicator.setText(LocalizeValue.localizeTODO("Updating..."));

Comment on lines 124 to 128
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oldText is saved but the progress indicator text is only restored at the very end of the method. All early return GitUpdateResult.NOT_READY; paths (and any exception before line 149) leave the indicator text as "Updating...", which can leak into subsequent operations if the same indicator instance is reused. Consider wrapping the body in a try/finally that always restores oldText, or restoring it immediately before each early return.

Copilot uses AI. Check for mistakes.
for (GitRepository repository : myRepositories) {
repository.update();
Expand All @@ -146,7 +146,7 @@ public GitUpdateResult update(UpdateMethod updateMethod) {
try (AccessToken ignored = DvcsUtil.workingTreeChangeStarted(myProject, "VCS Update")) {
result = updateImpl(updateMethod);
}
myProgressIndicator.setTextValue(oldText);
myProgressIndicator.setText(oldText);
return result;
}

Expand Down
Loading