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

[PATCH QGit] Fix "Save as..." for a file changed in the working dir

From
Markus Heidelberg <markus.heidelberg@web.de>
Date
Jun 13, 2009, 11:04 UTC
Message-ID
<1244891044-10582-2-git-send-email-markus.heidelberg@web.de>

The second argument of Git::saveFile() is the filename, but the commit SHA1 has been used, leading to the following error message:

An error occurred while executing command:
cat 0000000000000000000000000000000000000000
Git says:
/bin/cat: 0000000000000000000000000000000000000000: No such file or directory
Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
---
	Is there a difference between rv->st.fileName() and f.filename()?
	They seem to be equal, I chose the former for the function call.
 src/mainimpl.cpp |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/mainimpl.cpp b/src/mainimpl.cpp
index bd19ea1..382dc5d 100644
--- a/src/mainimpl.cpp
+++ b/src/mainimpl.cpp
@@ -1353,7 +1353,7 @@ void MainImpl::ActSaveFile_activated() {
 
 	QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
 	QString fileSha(git->getFileSha(rv->st.fileName(), rv->st.sha()));
-	if (!git->saveFile(fileSha, rv->st.sha(), fileName))
+	if (!git->saveFile(fileSha, rv->st.fileName(), fileName))
 		statusBar()->showMessage("Unable to save " + fileName);
 
 	QApplication::restoreOverrideCursor();
-- 
1.6.3.2.248.g8cb59
Message 1 of 1 in “Fix "Save as..." for a file changed in the working dir”
  1. Fix "Save as..." for a file changed in the working dirMarkus Heidelberg, Jun 13, 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.