def _check_worktree_support(failhard=True):
 git_version = version(versioninfo=False)
 if (_LooseVersion(git_version) < _LooseVersion('2.5.0')):
  if failhard:
   raise CommandExecutionError((('Worktrees are only supported in git 2.5.0 and newer (detected git version: ' + git_version) + ')'))
  return False
 return True

def _check_worktree_support ( failhard = True ) : git_version = version ( versioninfo = False ) if ( _LooseVersion ( git_version ) < _LooseVersion ( '2.5.0' ) ) : if failhard : raise CommandExecutionError ( ( ( 'Worktrees are only supported in git 2.5.0 and newer (detected git version: ' + git_version ) + ')' ) ) return False return True
ensure that we dont try to operate on worktrees in git < 2 .