Class: Gitodo::GitService

Inherits:
Slayer::Service
  • Object
show all
Defined in:
lib/gitodo/services/git_service.rb

Class Method Summary collapse

Class Method Details

.current_branchObject



8
9
10
# File 'lib/gitodo/services/git_service.rb', line 8

def self.current_branch
  branch = `git branch | grep \\* | cut -d ' ' -f2`.strip
end

.git_repo_rootObject



12
13
14
# File 'lib/gitodo/services/git_service.rb', line 12

def self.git_repo_root
  `git rev-parse --show-toplevel`.strip
end

.is_git_repoObject



4
5
6
# File 'lib/gitodo/services/git_service.rb', line 4

def self.is_git_repo
  `git rev-parse --is-inside-work-tree`.strip == "true"
end