module Rugged
  class Diff
    class Delta
      def new_blob
        blob(new_file)
      end

      def old_blob
        blob(old_file)
      end

      def repo
        diff.tree.repo
      end

      private

      def blob(file)
        return if file.nil?
        return if file[:oid] == '0000000000000000000000000000000000000000'

        repo.lookup(file[:oid])
      end
    end
  end
end

module Rugged
  class Diff
    class Delta
      def repo
        diff.tree.repo
      end

      def new_file_full_path
        repo_path = Pathname.new(repo.path).parent
        repo_path.join(new_file[:path])
      end
    end
  end
end

Add new_file_full_path method on Rugged::Diff::Delta
Add new_file_full_path method on Rugged::Diff::Delta
