def format_project_string(repo_path, name):
    """Return formatted project name"""
    if git_is_dirty(repo_path):
        color = 'red'
        symbol = '*'
    else:
        color = 'green'
        symbol = ''
    return colored(name + symbol, color)
Exemple #2
0
 def is_dirty(self):
     """Check if project is dirty"""
     return git_is_dirty(self.full_path())
Exemple #3
0
 def is_dirty(self):
     """Check if project is dirty"""
     return git_is_dirty(self.clowder_path)
def validate_repo_state(repo_path):
    """Validate repo state"""
    if not os.path.isdir(os.path.join(repo_path, '.git')):
        return True
    return not git_is_dirty(repo_path)
def print_validation(repo_path):
    """Print validation messages"""
    if not os.path.isdir(os.path.join(repo_path, '.git')):
        return
    if git_is_dirty(repo_path):
        print(' - Dirty repo. Please stash, commit, or discard your changes')
 def test_git_is_dirty(self):
     """Test git_is_detached() function"""
     self.assertFalse(git_is_dirty(self.jules_project_path))
     self.assertTrue(git_is_dirty(self.kishka_project_path))
     self.assertFalse(git_is_dirty(self.kit_project_path))