def test_log_with_paths_and_branches(self):
        # branch is also a bare parameter in git, so let's make sure branches
        # and paths play nicely together. Not as important to test this in hg
        vcs = self.get_vcs()

        # Create another branch and move it ahead of the master branch
        check_call('git checkout -b B2'.split(' '), cwd=self.remote_path)
        self._add_file('BAZ', self.remote_path, commit_msg='second branch commit')

        # Create a third branch off master with a commit not in B2
        check_call(['git', 'checkout', vcs.get_default_revision()], cwd=self.remote_path)
        check_call('git checkout -b B3'.split(' '), cwd=self.remote_path)
        self._add_file('IPSUM', self.remote_path, commit_msg='3rd branch')

        vcs.clone()
        vcs.update()

        # Ensure git log normally includes commits from all branches
        revisions = list(vcs.log())
        assert len(revisions) == 4

        # While in B3, do a git log on B2. FOO and BAZ should show up, but not
        # IPSUM
        revisions = list(vcs.log(branch='B2', paths=["FOO", "BAZ", "IPSUM"]))
        assert len(revisions) == 2

        # Sanity check master
        check_call(['git', 'checkout', vcs.get_default_revision()], cwd=self.remote_path)
        revisions = list(vcs.log(branch=vcs.get_default_revision()))
        assert len(revisions) == 2
dataset/ETHPy150Open dropbox/changes/tests/changes/vcs/test_git.py/GitVcsTest.test_log_with_paths_and_branches/original