From 8ba1e64be04c9d70c964e4580e5106d4a492a435 Mon Sep 17 00:00:00 2001 From: Andre Hartmann Date: Sun, 24 Nov 2024 18:13:17 +0100 Subject: [PATCH] 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 --- src/plugins/git/gitclient.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index 2359732fddb..f592ba1144e 100644 --- a/src/plugins/git/gitclient.cpp +++ b/src/plugins/git/gitclient.cpp @@ -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 (!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);