def create_single_file_and_add_to_repository(self, gitrepo):
        filename = repo_test_utils._create_random_file(self.directory)
        gitrepo.add(filename)

        #verify the file is not committed
        status = gitrepo.run_git("status --porcelain")
        eq_("A  %s\n" % (os.path.basename(filename),), status)
 def create_test_changesets(self, repo, count=1, dates=[]):
     for i in range(count):
         filename = repo_test_utils._create_random_file(self.directory)
         commands.add(repo.get_ui(), repo.get_repo(), filename)
         
         date=None
         if i < len(dates):
             date=dates[i]
         commands.commit(repo.get_ui(), repo.get_repo(), date=date, message="creating test commit", user='******')
 def test_adding_a_file_adds_it_to_the_git_index(self):
     gitrepo = GitRepository(self.directory, init=True)
     filename = repo_test_utils._create_random_file(self.directory)
     gitrepo.add(filename)
     status = gitrepo.run_git("status --porcelain")
     eq_("A  %s\n" % (os.path.basename(filename),), status)