Skip to content

Commit

Permalink
Return a path instead of string from Repository#path
Browse files Browse the repository at this point in the history
  • Loading branch information
mmozuras committed Sep 10, 2014
1 parent b2575d7 commit 013c4c4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 1 addition & 4 deletions lib/pronto/git/patch.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
require 'pathname'

module Pronto
module Git
class Patch < Struct.new(:patch, :repo)
Expand Down Expand Up @@ -36,8 +34,7 @@ def deleted_lines
end

def new_file_full_path
repo_path = Pathname.new(repo.path).parent
repo_path.join(delta.new_file[:path])
repo.path.join(delta.new_file[:path])
end
end
end
Expand Down
4 changes: 3 additions & 1 deletion lib/pronto/git/repository.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require 'pathname'

module Pronto
module Git
class Repository
Expand Down Expand Up @@ -29,7 +31,7 @@ def show_commit(sha)
end

def path
@repo.path
Pathname.new(@repo.path).parent
end

def blame(patch, lineno)
Expand Down

0 comments on commit 013c4c4

Please sign in to comment.