Class: KnapsackPro::RepositoryAdapters::GitAdapter
- Inherits:
-
BaseAdapter
- Object
- BaseAdapter
- KnapsackPro::RepositoryAdapters::GitAdapter
- Defined in:
- lib/knapsack_pro/repository_adapters/git_adapter.rb
Instance Method Summary collapse
Instance Method Details
#branch ⇒ Object
8 9 10 |
# File 'lib/knapsack_pro/repository_adapters/git_adapter.rb', line 8 def branch `git -C "#{working_dir}" rev-parse --abbrev-ref HEAD`.strip end |
#branches ⇒ Object
12 13 14 15 |
# File 'lib/knapsack_pro/repository_adapters/git_adapter.rb', line 12 def branches str_branches = `git rev-parse --abbrev-ref --branches` str_branches.split("\n") end |
#commit_hash ⇒ Object
4 5 6 |
# File 'lib/knapsack_pro/repository_adapters/git_adapter.rb', line 4 def commit_hash `git -C "#{working_dir}" rev-parse HEAD`.strip end |