git: use force branch checkout to prevent cases when .gitattributes modifies

files by specific rule and then checkout is blocked by potential file conflicts.
This commit is contained in:
Marcin Kuzminski 2018-01-29 14:37:03 +01:00
parent 0bc9813397
commit c36b8f3d79

View file

@ -900,10 +900,10 @@ class GitRepository(BaseRepository):
# fetch proper commits for merge testing
if source_ref.name != target_ref.name:
if shadow_repo.get_remote_ref(source_ref.name):
shadow_repo._checkout(source_ref.name)
shadow_repo._checkout(source_ref.name, force=True)
# checkout target
shadow_repo._checkout(target_ref.name)
shadow_repo._checkout(target_ref.name, force=True)
shadow_repo._local_pull(self.path, target_ref.name)
# Need to reload repo to invalidate the cache, or otherwise we cannot