Skip to content

Incorrect Diff object contents #194

@jatinganhotra

Description

@jatinganhotra

Hi,

When I run the following steps on the project - Github - LightTable
I noticed that the number of entries for Difffiles in Diff object is different than the number of entries in the stats[:total] for the Diff object.

$rubygit_gem_repo = Git.open(git_repo_path, :log => Logger.new(STDOUT))
commit_list = $rubygit_gem_repo.log(nil)
commit_list_array = commit_list.to_a
commit_list_array.reverse!
prev_commit = commit_list_array[8]
next_commit = commit_list_array[9]
prev_sha = prev_commit.sha
 => "2c9b866d8fd6ed45fb896ed2f9c8edf6e38f6069"
next_sha = next_commit.sha
 => "ce8a4f0a910f58acaaf4f8c8a964afdf03f16d37"
diff = diff_bw_commits.to_a
puts diff.size
 => 137
puts diff_bw_commits.stats[:total]
 => {:insertions=>11317, :deletions=>1245, :lines=>12562, :files=>134}

I went further to find the inconsistency and found that the file names are incorrect in both cases - i.e. in the stats object and the Difffile objects.
I've attached the file names in the following Gist - https://gist.github.com/silverSpoon/3aeb985e56b37583c08a

The exact problem is also present in other open-source projects too, such as
https://github.com/basho/riak.git
https://github.com/thinkaurelius/titan.git
https://github.com/atom/atom.git

I can pin-point the exact commits for these projects too, if that helps.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions