maks / MGit

A Git client for Android.
https://manichord.com/projects/mgit.html
GNU General Public License v3.0
1.22k stars 166 forks source link

'Auto stage modified files' commit ignores skip-worktree flag #673

Open Zkaij opened 1 year ago

Zkaij commented 1 year ago

It seems that the 'Auto stage modified files' option ignores the skip-worktree flag. Flagged files are staged and committed despite not appearing on the Status listing.

To Reproduce Steps to reproduce the behavior:

  1. Modify any file
  2. Set the skip-worktree flag on the file (using git update-index --skip-worktree [filename] on an external application)
  3. In MGit, Commit on the current repository, selecting 'Auto stage modified files'
  4. Changes to flagged file will be included in commit

Expected behavior File should not be staged nor committed.

Smartphone:

maks commented 1 year ago

Thanks for raising this issue. I think there maybe a bit of confusion here. From what I understand skip-worktree operates on the index file, which will be per working copy of the local repo. So when you say in step 2. "on an external application" could you please provide more detail exactly how you are doing that?

Zkaij commented 1 year ago

I used the Termux app on the same device to run the command. Would that not apply to the same index file? It certainly seemed to do something, given that it changed the listing in the Status pane (i.e. removed the flagged files from those changed), which indicates that something isn't right here.