Closed fjsanpedro closed 5 years ago
Thanks for the PR. I just have a minor suggestion regarding style; otherwise I think the PR is ready for merging. 👍
@bartkamphorst PR updated 😉
@bartkamphorst ready to merge then?
I suppose so!
Done. Sorry for the wait @fjsanpedro!
no worries, thanks @dometto 😉
It seems there is a problem with versions when a gollum_page is moved to a different directory using git. The steps to reproduce is this:
Create, commit and push a page using git. The resulting commit is this:
This commit id is:
0d4343068b0ccd219808015ddf020563d0d6c348
.Now, move the gollum_page to a different directory, in this example would be
foo/bar.md
. The resulting commit is:This commit id is:
195ce8d51dcaa49182e7b825cd2fd985b80195b0
Now let ask the gollum_page about the versions:
The problem is due to the
tree_entry
method which returns that there is a valid entry forfoo/bar.md
in the create commit, which is not true. That makes thatcommit_touches_path?
for the move commit returns false and hence the commit added to thebuild_log
method is only the create one.In this PR, what I do is returning
nil
if the current_commit does not have thedir
, then thecommit_touches_path?
will return true and thebuild_log
will add the move commit. This way thelast_version
andversion
of the gollum page will be pointing to the same commit.