Class: Reflog
- Inherits:
-
Object
- Object
- Reflog
- Defined in:
- lib/reflog.rb
Instance Method Summary collapse
-
#initialize ⇒ Reflog
constructor
A new instance of Reflog.
- #next ⇒ Object
- #pick ⇒ Object
- #prev ⇒ Object
- #show ⇒ Object
Constructor Details
#initialize ⇒ Reflog
Returns a new instance of Reflog.
3 4 5 |
# File 'lib/reflog.rb', line 3 def initialize @pointer = 0 end |
Instance Method Details
#next ⇒ Object
7 8 9 |
# File 'lib/reflog.rb', line 7 def next @pointer += 1 end |
#pick ⇒ Object
19 20 21 |
# File 'lib/reflog.rb', line 19 def pick `git reset --hard HEAD@{#{@pointer}}` end |
#prev ⇒ Object
11 12 13 |
# File 'lib/reflog.rb', line 11 def prev @pointer -= 1 if @pointer > 0 end |
#show ⇒ Object
15 16 17 |
# File 'lib/reflog.rb', line 15 def show `git show HEAD@{#{@pointer}}` end |