Git: Fix missing branch name on amend last commit

parseFilesFromStatus() does not only parse the files
to be included in the commit, but also parses the
branch name shown in the info panel.

But if the repo contains no modified files, status is
set to StatusUnchanged and so parseFilesFromStatus()
was never called.

Change-Id: I4698c7366b41fa2af6bc31040c3d2397be91c4df
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Andre Hartmann
2024-11-24 18:13:17 +01:00
committed by André Hartmann
parent efc0d34abd
commit 8ba1e64be0

View File

@@ -2768,12 +2768,12 @@ bool GitClient::getCommitData(const FilePath &workingDirectory,
// R old -> new
// D deleted_file
// ?? untracked_file
if (status != StatusUnchanged) {
if (!commitData.parseFilesFromStatus(output)) {
*errorMessage = msgParseFilesFailed();
return false;
}
if (status != StatusUnchanged) {
// Filter out untracked files that are not part of the project
QStringList untrackedFiles = commitData.filterFiles(UntrackedFile);