refactoring and testing fork&pull request

- added CloneAndFetchTemplate to reduce duplicated codes in GitRepository.
- added some tests for GitRepository and CloneAndFetchTemplate.