예제 #1
0
def get_branch_name(base_dir):
	head = os.path.join(base_dir, '.git', 'HEAD')
	try:
		return _get_branch_name(base_dir, head, branch_name_from_config_file)
	except OSError as e:
		if getattr(e, 'errno', None) == errno.ENOTDIR or getattr(e, 'winerror', None) == 3:
			# We are in a submodule
			return '(no branch)'
		raise
예제 #2
0
파일: git.py 프로젝트: zundr/powerline
def get_branch_name(base_dir):
    head = os.path.join(base_dir, '.git', 'HEAD')
    try:
        return _get_branch_name(base_dir, head, branch_name_from_config_file)
    except OSError as e:
        if getattr(e, 'errno', None) == errno.ENOTDIR or getattr(
                e, 'winerror', None) == 3:
            # We are in a submodule
            return '(no branch)'
        raise
예제 #3
0
def get_branch_name(base_dir):
	head = os.path.join(git_directory(base_dir), 'HEAD')
	return _get_branch_name(base_dir, head, branch_name_from_config_file)