Skip to content

Add inverse parameter to diff_parent #22

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions lib/git/object.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@ def grep(string, path_limiter = nil, opts = {})
@base.lib.grep(string, opts)
end

def diff(objectish)
Git::Diff.new(@base, @objectish, objectish)
def diff(objectish,inverse)
return Git::Diff.new(@base, @objectish, objectish) unless inverse
Git::Diff.new(@base, objectish, @objectish)
end

def log(count = 30)
Expand Down Expand Up @@ -203,8 +204,8 @@ def committer_date
end
alias_method :date, :committer_date

def diff_parent
diff(parent)
def diff_parent(inverse=false)
diff(parent,inverse)
end

def set_commit(data)
Expand Down