diff options
| author | Andre Hartmann <aha_1980@gmx.de> | 2025-06-20 11:54:05 +0200 |
|---|---|---|
| committer | André Hartmann <aha_1980@gmx.de> | 2025-06-20 11:07:04 +0000 |
| commit | bdf571cdc8092d5230b51b008ed6450b1b8d2255 (patch) | |
| tree | ee25dc2c4b8f34eb420296e00348b5d103b12ed6 /src/plugins/git/gitclient.cpp | |
| parent | 5881e99ef188b11815298b688d69dc95d2be2236 (diff) | |
Git: Avoid all branches option for line log
Both options contradict and lead to an error message if the
file is changed in two branches foo and bar:
fatal: More than one commit to dig from:
refs/heads/foo and refs/heads/bar?
Change-Id: I8f7c652aa2000e9e5d258bf1b584d39f267e4198
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Diffstat (limited to 'src/plugins/git/gitclient.cpp')
| -rw-r--r-- | src/plugins/git/gitclient.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index 2cb6a4547d1..cb52e2e5573 100644 --- a/src/plugins/git/gitclient.cpp +++ b/src/plugins/git/gitclient.cpp @@ -70,6 +70,7 @@ const char colorOption[] = "--color=always"; const char patchOption[] = "--patch"; const char graphOption[] = "--graph"; const char decorateOption[] = "--decorate"; +const char allBranchesOption[] = "--all"; using namespace Core; using namespace DiffEditor; @@ -639,7 +640,7 @@ public: : GitBaseConfig(editor) { QAction *allBranchesButton = addToggleButton( - QStringList{"--all"}, + QStringList{allBranchesOption}, Tr::tr("All", "All branches"), Tr::tr("Show log for all local branches.")); mapSetting(allBranchesButton, &settings().allBranches); @@ -1176,6 +1177,11 @@ void GitClient::log(const FilePath &workingDirectory, const QString &fileName, } else { editor->setHighlightingEnabled(false); } + + // remove "all branches" option when "log for line" is requested as they conflict + if (Utils::anyOf(arguments, [](const QString &arg) { return arg.startsWith("-L "); })) + arguments.removeAll(allBranchesOption); + if (!arguments.contains(graphOption) && !arguments.contains(patchOption)) arguments << normalLogArguments(); |
