Ejemplo n.º 1
0
    def test_get_untracked_paths_nested(self):
        with open(os.path.join(self.repo.path, 'notignored'), 'w') as f:
            f.write('blah\n')
        subrepo = Repo.init(os.path.join(self.repo.path, 'nested'), mkdir=True)
        with open(os.path.join(subrepo.path, 'another'), 'w') as f:
            f.write('foo\n')

        self.assertEqual(
            set(['notignored']),
            set(porcelain.get_untracked_paths(self.repo.path, self.repo.path,
                                              self.repo.open_index())))
        self.assertEqual(
            set(['another']),
            set(porcelain.get_untracked_paths(subrepo.path, subrepo.path,
                                              subrepo.open_index())))
Ejemplo n.º 2
0
    def test_get_untracked_paths_nested(self):
        with open(os.path.join(self.repo.path, 'notignored'), 'w') as f:
            f.write('blah\n')
        subrepo = Repo.init(os.path.join(self.repo.path, 'nested'), mkdir=True)
        with open(os.path.join(subrepo.path, 'another'), 'w') as f:
            f.write('foo\n')

        self.assertEqual(
            set(['notignored']),
            set(porcelain.get_untracked_paths(self.repo.path, self.repo.path,
                                              self.repo.open_index())))
        self.assertEqual(
            set(['another']),
            set(porcelain.get_untracked_paths(subrepo.path, subrepo.path,
                                              subrepo.open_index())))
Ejemplo n.º 3
0
 def test_get_untracked_paths(self):
     with open(os.path.join(self.repo.path, '.gitignore'), 'w') as f:
         f.write('ignored\n')
     with open(os.path.join(self.repo.path, 'ignored'), 'w') as f:
         f.write('blah\n')
     with open(os.path.join(self.repo.path, 'notignored'), 'w') as f:
         f.write('blah\n')
     self.assertEqual(
         set(['ignored', 'notignored', '.gitignore']),
         set(porcelain.get_untracked_paths(self.repo.path, self.repo.path,
                                           self.repo.open_index())))
     self.assertEqual(set(['.gitignore', 'notignored']),
                      set(porcelain.status(self.repo).untracked))
     self.assertEqual(set(['.gitignore', 'notignored', 'ignored']),
                      set(porcelain.status(self.repo, ignored=True)
                          .untracked))
Ejemplo n.º 4
0
 def test_get_untracked_paths(self):
     with open(os.path.join(self.repo.path, '.gitignore'), 'w') as f:
         f.write('ignored\n')
     with open(os.path.join(self.repo.path, 'ignored'), 'w') as f:
         f.write('blah\n')
     with open(os.path.join(self.repo.path, 'notignored'), 'w') as f:
         f.write('blah\n')
     self.assertEqual(
         set(['ignored', 'notignored', '.gitignore']),
         set(porcelain.get_untracked_paths(self.repo.path, self.repo.path,
                                           self.repo.open_index())))
     self.assertEqual(set(['.gitignore', 'notignored']),
                      set(porcelain.status(self.repo).untracked))
     self.assertEqual(set(['.gitignore', 'notignored', 'ignored']),
                      set(porcelain.status(self.repo, ignored=True)
                          .untracked))