TISTUD-5176 and TISTUD-5151

- TISTUD-5151 Errors occurred while refreshing git index ( importing KitchenSink from Samples)
- TISTUD-5176 NPE error occured when imported samples from Studio without setting git repository
  - Try to avoid NPE when accessing potentially null branches field.
  - When disposing a repo make sure to stop all jobs related to the repo (coming from file watcher hooks)