Class: Reflog

Inherits:
Object
  • Object
show all
Defined in:
lib/reflog.rb

Instance Method Summary collapse

Constructor Details

#initializeReflog

Returns a new instance of Reflog.



3
4
5
# File 'lib/reflog.rb', line 3

def initialize
  @pointer = 0
end

Instance Method Details

#nextObject



7
8
9
# File 'lib/reflog.rb', line 7

def next
  @pointer += 1
end

#pickObject



19
20
21
# File 'lib/reflog.rb', line 19

def pick
  `git reset --hard HEAD@{#{@pointer}}`
end

#prevObject



11
12
13
# File 'lib/reflog.rb', line 11

def prev
  @pointer -= 1 if @pointer > 0
end

#showObject



15
16
17
# File 'lib/reflog.rb', line 15

def show
  `git show HEAD@{#{@pointer}}`
end