ea2d8c4905db016b4ba5db7abbf303bcaddb35f9,tests/python/twitter/pants/scm/test_git.py,GitTest,setUpClass,#Any#,73

Before Change


    cls.readme_file = os.path.join(cls.worktree, "README")

    with environment_as(GIT_DIR=cls.gitdir, GIT_WORK_TREE=cls.worktree):
      subprocess.check_call(["git", "init"])
      subprocess.check_call(["git", "remote", "add", "depot", cls.origin])

      touch(cls.readme_file)
      subprocess.check_call(["git", "add", "README"])
      subprocess.check_call(["git", "commit", "-am", "initial commit."])
      subprocess.check_call(["git", "tag", "-a", "-m", "first tag", "first"])
      subprocess.check_call(["git", "push", "--tags", "depot", "master"])

      with safe_open(cls.readme_file, "w") as readme:
        readme.write("Hello World.")
      subprocess.check_call(["git", "commit", "-am", "Update README."])

    cls.clone2 = safe_mkdtemp()
    with pushd(cls.clone2):
      subprocess.check_call(["git", "init"])
      subprocess.check_call(["git", "remote", "add", "origin", cls.origin])
      subprocess.check_call(["git", "pull", "--tags", "origin", "master:master"])

      with safe_open(os.path.realpath("README"), "a") as readme:

After Change



  @classmethod
  def setUpClass(cls):
    cls.origin = safe_mkdtemp()
    with pushd(cls.origin):
      subprocess.check_call(["git", "init", "--bare"])

    cls.gitdir = safe_mkdtemp()
    cls.worktree = safe_mkdtemp()

    cls.readme_file = os.path.join(cls.worktree, "README")

    with environment_as(GIT_DIR=cls.gitdir, GIT_WORK_TREE=cls.worktree):
      cls.init_repo("depot", cls.origin)

      touch(cls.readme_file)
      subprocess.check_call(["git", "add", "README"])
      subprocess.check_call(["git", "commit", "-am", "initial commit."])
      subprocess.check_call(["git", "tag", "-a", "-m", "first tag", "first"])
      subprocess.check_call(["git", "push", "--tags", "depot", "master"])
      subprocess.check_call(["git", "branch", "--set-upstream", "master", "depot/master"])

      with safe_open(cls.readme_file, "w") as readme:
        readme.write("Hello World.")
      subprocess.check_call(["git", "commit", "-am", "Update README."])

    cls.clone2 = safe_mkdtemp()
    with pushd(cls.clone2):
      cls.init_repo("origin", cls.origin)
      subprocess.check_call(["git", "pull", "--tags", "origin", "master:master"])

      with safe_open(os.path.realpath("README"), "a") as readme:
        readme.write("--")
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 17

Instances


Project Name: pantsbuild/pants
Commit Name: ea2d8c4905db016b4ba5db7abbf303bcaddb35f9
Time: 2013-05-13
Author: benjyw@gmail.com
File Name: tests/python/twitter/pants/scm/test_git.py
Class Name: GitTest
Method Name: setUpClass


Project Name: pantsbuild/pants
Commit Name: 3d16646b8fbee5ae81818c76bef43db27d14f5d9
Time: 2013-05-13
Author: jsirois@twitter.com
File Name: tests/python/twitter/pants/scm/test_git.py
Class Name: GitTest
Method Name: setUpClass


Project Name: pantsbuild/pants
Commit Name: ea2d8c4905db016b4ba5db7abbf303bcaddb35f9
Time: 2013-05-13
Author: benjyw@gmail.com
File Name: tests/python/twitter/pants/scm/test_git.py
Class Name: GitTest
Method Name: setUpClass


Project Name: pantsbuild/pants
Commit Name: ae82346f8a345cef68339dc34f5cf89b6a18d01f
Time: 2013-05-10
Author: jsirois@twitter.com
File Name: tests/python/twitter/pants/scm/test_git.py
Class Name: GitTest
Method Name: setUpClass