Fix for commits without a parent not returning a diff
Review Request #7054 — Created March 12, 2015 and submitted
Currently, the route /repos/{repo}/commits/{id} will not return a diff if the commit has no parent. This fixes that.
Made sure that a diff is returned even when the commit has no parent.
Description | From | Last Updated |
---|---|---|
What happens in the case where there are multiple parents (i.e., a merge commit)? If we aren't going to support … |
brennie | |
I don't know if this is against gofmt but can you align the parameters like we do in Python, e.g. … |
brennie | |
Can this be refactored so that we only have one call of gitRepo.DiffTreeToTree (after the if/else)? |
brennie |
-
-
git_repository.go (Diff revision 1) What happens in the case where there are multiple parents (i.e., a merge commit)? If we aren't going to support this we should error out somehow (that doesn't break RB).
-
git_repository.go (Diff revision 1) I don't know if this is against
gofmt
but can you align the parameters like we do in Python, e.g.gitRepo.DiffTreeToTree(parentTree, commitTree, &diffOptions)
If this is against
gofmt
, please drop this issue.
-
I am interested in the path, is it for github only? or all git repositories in general? Because paths might vary in different git services.
Change Summary:
Minor format/style changes
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 2 (+35 -28) |
-
Tool: PEP8 Style Checker Ignored Files: git_repository.go Tool: Pyflakes Ignored Files: git_repository.go
-
One minor refactor and then I say we Ship it!
-
git_repository.go (Diff revision 2) Can this be refactored so that we only have one call of
gitRepo.DiffTreeToTree
(after the if/else)?
Change Summary:
Barret's suggestion + a bit more tidy up.
Commit: |
|
||||
---|---|---|---|---|---|
Diff: |
Revision 3 (+31 -32) |