Skip to content

Commit 9f795da

Browse files
Merge branch 'revert-support' of git://github.com/fasttracktool-dev/ruby-git into fasttracktool-dev-revert-support
Conflicts: lib/git/base.rb lib/git/lib.rb tests/units/test_index_ops.rb
1 parent b8f719d commit 9f795da

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

lib/git/lib.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,9 +430,13 @@ def clean(opts = {})
430430
end
431431

432432
def revert(commitish, opts = {})
433+
# Forcing --no-edit as default since it's not an interactive session.
434+
opts = {:'no-edit' => true}.merge(opts)
435+
433436
arr_opts = []
434-
arr_opts << '--no-edit' if opts[:no_edit] || opts[:'no-edit']
437+
arr_opts << '--no-edit' if opts[:'no-edit']
435438
arr_opts << commitish
439+
436440
command('revert', arr_opts)
437441
end
438442

tests/units/test_index_ops.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def test_revert
8383
new_file('test-file2', 'blablahbla')
8484
g.add
8585
g.commit("second-commit")
86-
second_commit = g.gcommit('HEAD')
86+
g.gcommit('HEAD')
8787

8888
commits = g.log(1e4).count
8989
g.revert(first_commit.sha)

0 commit comments

Comments
 (0)