Details
-
Bug
-
Resolution: Done
-
P2: Important
-
Qt Creator 4.15.0, Qt Creator 6.0.2
-
Ubuntu 20.04 LTS
git 2.25.1
-
dd70101d7b (qt-creator/qt-creator/7.0) dd70101d7b (qt-creator/qt-creator/master) dd70101d7b (qt-creator/tqtc-qt-creator/master)
Description
- Open a file from a git repository.
- Select "Tools" -> "Git" -> "Local Repository" -> "Branches..." from the menu.
Creator's right sidebar appears, showing the list of branches. - Right-click on a branch.
- Select "Diff" from the context menu.
Creator's diff viewer will show "Retrieving data failed." In the "Version Control" view, you can read:Cannot run "git rev-parse --git-dir" in "": fatal: not a git repository (or any parent up to mount point /) Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set). 17:49:55 Running: /usr/bin/git -c diff.color=false diff -m -M -C --first-parent --unified=3 --src-prefix=a/ --dst-prefix=b/ refs/remotes/google/cfl-local-filestore error: unknown switch `m' usage: git diff --no-index [<options>] <path> <path> (...) [list of allowed options] The command "/usr/bin/git -c diff.color=false diff -m -M -C --first-parent --unified=3 --src-prefix=a/ --dst-prefix=b/ refs/remotes/google/cfl-local-filestore" terminated with exit code 129.
The shown list of options does not contain "-m", but the same command succeeds when showing a diff against a revision from a log. So the actual problem seems to be that "git diff" is being executed in the wrong working directory.