+ def test_catch_up(self) -> None:
+ _git(self.upstream, 'checkout', '-b', 'otherbranch')
+ _commit_file(self.upstream, 'foofile', 'foo', 'Foo')
+ rev = _git(self.upstream, 'log', '--format=%H', '-n1').strip().decode()
+ d = git_cache.ensure_rev_available(self.upstream, 'otherbranch', rev)
+ self.assertEqual(_git(d, 'show', '%s:foofile' % rev), b'foo')
+ _git(self.upstream, 'checkout', 'master')
+ _git(self.upstream, 'merge', '--ff-only', 'otherbranch')
+ d = git_cache.ensure_rev_available(self.upstream, 'master', rev)
+ self.assertEqual(_git(d, 'show', '%s:foofile' % rev), b'foo')
+