The same just happened to me because I had move the git source repo with the sources from HOME to /opt/ and changed the ownership. (So even git status
here was giving an error)
The error was solved after doing:
git config --global --add safe.directory /opt/Slicer_src