git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[EGIT PATCH] Make commit amend work when a resource is selected

From
Robin Rosenberg <robin.rosenberg@dewire.com>
Date
Mar 9, 2009, 22:35 UTC
Message-ID
<1236638139-17806-1-git-send-email-robin.rosenberg@dewire.com>

We previously made it possible to commit when any resource was selected. Due to the internal workings of the commit action the patch was not enough to extend this functionality into the amend mode.

Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
---
 .../egit/ui/internal/actions/CommitAction.java     |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/CommitAction.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/CommitAction.java
index 5996596..03649c6 100644
--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/CommitAction.java
+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/CommitAction.java
@@ -175,7 +175,7 @@ private void performCommit(CommitDialog commitDialog, String commitMessage)
 		} catch (IOException e) {
 			throw new TeamException("Committing changes", e);
 		}
-		for (IProject proj : getSelectedProjects()) {
+		for (IProject proj : getProjectsForSelectedResources()) {
 			RepositoryMapping.getMapping(proj).fireRepositoryChanged();
 		}
 	}
@@ -230,7 +230,7 @@ private void prepareTrees(IFile[] selectedItems,
 			UnsupportedEncodingException {
 		if (selectedItems.length == 0) {
 			// amending commit - need to put something into the map
-			for (IProject proj : getSelectedProjects()) {
+			for (IProject proj : getProjectsForSelectedResources()) {
 				Repository repo = RepositoryMapping.getMapping(proj).getRepository();
 				if (!treeMap.containsKey(repo))
 					treeMap.put(repo, repo.mapTree(Constants.HEAD));
-- 
1.6.1.285.g35d8b
Message 1 of 1 in “Make commit amend work when a resource is selected”
  1. Make commit amend work when a resource is selectedRobin Rosenberg, Mar 9, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.