commit: fix the 'stage changed files to commit' logic