ipfs / go-ipld-git

ipld handlers for git objects
MIT License
57 stars 19 forks source link

Fix mergetag resolving #19

Closed magik6k closed 6 years ago

magik6k commented 6 years ago

I did test this manually on QmT6iL1p24kMQZTsD1u3QXPJrwfo7bwYL339WCKrwK2G9F/refs/heads/master/parents/0 (linux-stable). Not sure how to create a commit with mergetag for testing.

magik6k commented 6 years ago

Made it use heredoc instead of echos.

MergeTag is only created when merging signed tags, see https://github.com/git/git/blob/master/commit.c#L1212-L1214, so --no-ff alone isn't enough.

magik6k commented 6 years ago

Added some tests, they are a bit weird, but it's hard to improve them without writing mock dagservice and hooking up resolver (which will be doable once resolver is extracted from go-ipfs), but that's out of scope for this PR.