File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -104,16 +104,16 @@ class Index
104
104
def diff ( *args )
105
105
options = args . last . is_a? ( Hash ) ? args . pop : { }
106
106
other = args . shift
107
- if other . nil?
107
+
108
+ case other
109
+ when nil
108
110
diff_index_to_workdir options
111
+ when ::Rugged ::Commit
112
+ diff_tree_to_index other . tree , options
113
+ when ::Rugged ::Tree
114
+ diff_tree_to_index other , options
109
115
else
110
- if other . is_a? ::Rugged ::Commit
111
- diff_tree_to_index other . tree , options
112
- elsif other . is_a? ::Rugged ::Tree
113
- diff_tree_to_index other , options
114
- else
115
- raise TypeError , "A Rugged::Commit or Rugged::Tree instance is required"
116
- end
116
+ raise TypeError , "A Rugged::Commit or Rugged::Tree instance is required"
117
117
end
118
118
end
119
119
You can’t perform that action at this time.
0 commit comments