class KnapsackPro::RepositoryAdapters::GitAdapter
Public Instance Methods
Source
# File lib/knapsack_pro/repository_adapters/git_adapter.rb, line 10 def branch `git -C "#{working_dir}" rev-parse --abbrev-ref HEAD`.strip end
Source
# File lib/knapsack_pro/repository_adapters/git_adapter.rb, line 14 def branches str_branches = `git rev-parse --abbrev-ref --branches` str_branches.split("\n") end
Source
# File lib/knapsack_pro/repository_adapters/git_adapter.rb, line 6 def commit_hash `git -C "#{working_dir}" rev-parse HEAD`.strip end
Private Instance Methods
Source
# File lib/knapsack_pro/repository_adapters/git_adapter.rb, line 64 def shallow_repository? result = `git rev-parse --is-shallow-repository 2>/dev/null` result.strip == 'true' end
Source
# File lib/knapsack_pro/repository_adapters/git_adapter.rb, line 69 def working_dir dir = KnapsackPro::Config::Env.project_dir File.expand_path(dir) end