Skip to content

Commit 257fd8d

Browse files
committed
fixes to stash apply so tests pass
1 parent b97ff5e commit 257fd8d

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

lib/git/lib.rb

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -413,9 +413,12 @@ def stash_save(message)
413413
output =~ /HEAD is now at/
414414
end
415415

416-
def stash_apply(id)
417-
command('stash apply', [id])
418-
# Already uptodate! ---???? What then
416+
def stash_apply(id = nil)
417+
if id
418+
command('stash apply', [id])
419+
else
420+
command('stash apply')
421+
end
419422
end
420423

421424
def stash_clear

lib/git/stashes.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ def save(message)
2222
@stashes.unshift(s) if s.saved?
2323
end
2424

25-
def apply(index=0)
26-
@base.lib.stash_apply(index.to_i)
25+
def apply(index=nil)
26+
@base.lib.stash_apply(index)
2727
end
2828

2929
def clear

0 commit comments

Comments
 (0)