francescmm / GitQlient

GitQlient: Multi-platform Git client written with Qt.
https://www.francescmm.com
GNU Lesser General Public License v2.1
843 stars 84 forks source link

[BUG] Stage files which contain spaces in their names #279

Closed relaxlex closed 1 year ago

relaxlex commented 1 year ago

Staging files which contain spaces in their names or in the path cannot be staged.

Steps to reproduce the behavior

  1. Create new git repo
  2. Create file with the name "Filename with spaces.md"
  3. Stage file in WIP view.
  4. File will be remove from staged files overview within seconds.

Expected behavior Files should be staged just like a file without spaces in the filename.

Debug log [Debug][Git][1684507805][00000000024829c0]{GitLocal.cpp:30} Staging file: {Filename with spaces.md} [Debug][Git][1684507805][00000000024829c0]{AGitProcess.cpp:179} Process started: git add Filename with spaces.md [Debug][Git][1684507805][00000000024829c0]{AGitProcess.cpp:189} Process {git add Filename with spaces.md} finished. [Warning][Git][1684507805][00000000024829c0]{GitBase.cpp:57} Git command {git add Filename with spaces.md} has errors: fatal: pathspec 'Filename' did not match any files

Desktop (please complete the following information):

Additional context Looks like filenames(including path) are not quoted before they are past on to the git command.

francescmm commented 1 year ago

Hi @relaxlex,

Thanks for the report and I'll look into it! :)