make more usage of context, to have more db transaction in one session (make diff of #9307 smaller)
git.Command.Run
git.Command.RunInDir*