Monorepo for Tangled tangled.org

knotserver: remove unused functions #603

merged opened by handle.invalid targeting master from [deleted fork]: knotserver/cleanup
Labels

None yet.

assignee

None yet.

Participants 2
AT URI
at://did:plc:s6urhemct6hiuyd5ytdlvnuw/sh.tangled.repo.pull/3lzq2x6w32322
+34
Interdiff #0 โ†’ #1
+34
knotserver/git/diff.go
··· 98 98 return &nd, nil 99 99 } 100 100 101 + func (g *GitRepo) DiffTree(commit1, commit2 *object.Commit) (*types.DiffTree, error) { 102 + tree1, err := commit1.Tree() 103 + if err != nil { 104 + return nil, err 105 + } 106 + 107 + tree2, err := commit2.Tree() 108 + if err != nil { 109 + return nil, err 110 + } 111 + 112 + diff, err := object.DiffTree(tree1, tree2) 113 + if err != nil { 114 + return nil, err 115 + } 116 + 117 + patch, err := diff.Patch() 118 + if err != nil { 119 + return nil, err 120 + } 121 + 122 + diffs, _, err := gitdiff.Parse(strings.NewReader(patch.String())) 123 + if err != nil { 124 + return nil, err 125 + } 126 + 127 + return &types.DiffTree{ 128 + Rev1: commit1.Hash.String(), 129 + Rev2: commit2.Hash.String(), 130 + Patch: patch.String(), 131 + Diff: diffs, 132 + }, nil 133 + } 134 + 101 135 // FormatPatch generates a git-format-patch output between two commits, 102 136 // and returns the raw format-patch series, a parsed FormatPatch and an error. 103 137 func (g *GitRepo) formatSinglePatch(commit plumbing.Hash, extraArgs ...string) (string, *types.FormatPatch, error) {
knotserver/git/git.go

This file has not been changed.

knotserver/http_util.go

This file has not been changed.

History

2 rounds 1 comment
sign up or login to add to the discussion
1 commit
expand
ee2c1a79
knotserver: remove unused functions
expand 1 comment

nice, thanks!

pull request successfully merged
1 commit
expand
900d2118
knotserver: remove unused functions
expand 0 comments