예제 #1
0
 def test_check_ignored(self):
     with open(os.path.join(self.repo.path, '.gitignore'), 'w') as f:
         f.write("foo")
     with open(os.path.join(self.repo.path, 'foo'), 'w') as f:
         f.write("BAR")
     with open(os.path.join(self.repo.path, 'bar'), 'w') as f:
         f.write("BAR")
     self.assertEqual(['foo'],
                      list(porcelain.check_ignore(self.repo, ['foo'])))
     self.assertEqual([], list(porcelain.check_ignore(self.repo, ['bar'])))
예제 #2
0
 def test_check_added(self):
     with open(os.path.join(self.repo.path, 'foo'), 'w') as f:
         f.write("BAR")
     self.repo.stage(['foo'])
     with open(os.path.join(self.repo.path, '.gitignore'), 'w') as f:
         f.write("foo\n")
     self.assertEqual([], list(porcelain.check_ignore(self.repo, ['foo'])))
     self.assertEqual(['foo'],
                      list(
                          porcelain.check_ignore(self.repo, ['foo'],
                                                 no_index=True)))
예제 #3
0
 def test_check_added(self):
     with open(os.path.join(self.repo.path, 'foo'), 'w') as f:
         f.write("BAR")
     self.repo.stage(['foo'])
     with open(os.path.join(self.repo.path, '.gitignore'), 'w') as f:
         f.write("foo\n")
     self.assertEqual(
         [], list(porcelain.check_ignore(self.repo, ['foo'])))
     self.assertEqual(
         ['foo'],
         list(porcelain.check_ignore(self.repo, ['foo'], no_index=True)))
예제 #4
0
 def test_check_ignored(self):
     with open(os.path.join(self.repo.path, '.gitignore'), 'w') as f:
         f.write("foo")
     with open(os.path.join(self.repo.path, 'foo'), 'w') as f:
         f.write("BAR")
     with open(os.path.join(self.repo.path, 'bar'), 'w') as f:
         f.write("BAR")
     self.assertEqual(
         ['foo'],
         list(porcelain.check_ignore(self.repo, ['foo'])))
     self.assertEqual([], list(porcelain.check_ignore(self.repo, ['bar'])))
예제 #5
0
파일: cli.py 프로젝트: codilemma/Python_env
 def run(self, args):
     parser = optparse.OptionParser()
     options, args = parser.parse_args(args)
     ret = 1
     for path in porcelain.check_ignore('.', args):
         print(path)
         ret = 0
     return ret