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

1 messages from 2009-06-13 to 2009-06-13. Participants: Markus Heidelberg.
Thread: https://gitlist.dev/t/19799

## Markus Heidelberg, 2009-06-13 11:04

Subject: [PATCH QGit] Fix "Save as..." for a file changed in the working dir
Message-ID: <1244891044-10582-2-git-send-email-markus.heidelberg@web.de>
URL: https://gitlist.dev/e/1244891044-10582-2-git-send-email-markus.heidelberg%40web.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

```
