(body)
| 154 | } |
| 155 | |
| 156 | function decodeCommit(body) { |
| 157 | var i = 0; |
| 158 | var start; |
| 159 | var key; |
| 160 | var parents = []; |
| 161 | var commit = { |
| 162 | tree: "", |
| 163 | parents: parents, |
| 164 | author: "", |
| 165 | committer: "", |
| 166 | message: "" |
| 167 | }; |
| 168 | while (body[i] !== 0x0a) { |
| 169 | start = i; |
| 170 | i = indexOf(body, 0x20, start); |
| 171 | if (i < 0) throw new SyntaxError("Missing space"); |
| 172 | key = bodec.toRaw(body, start, i++); |
| 173 | start = i; |
| 174 | i = indexOf(body, 0x0a, start); |
| 175 | if (i < 0) throw new SyntaxError("Missing linefeed"); |
| 176 | var value = bodec.toUnicode(body, start, i++); |
| 177 | if (key === "parent") { |
| 178 | parents.push(value); |
| 179 | } |
| 180 | else { |
| 181 | if (key === "author" || key === "committer") { |
| 182 | value = decodePerson(value); |
| 183 | } |
| 184 | commit[key] = value; |
| 185 | } |
| 186 | } |
| 187 | i++; |
| 188 | commit.message = bodec.toUnicode(body, i, body.length); |
| 189 | return commit; |
| 190 | } |
| 191 | |
| 192 | function decodeTag(body) { |
| 193 | var i = 0; |
nothing calls this directly
no test coverage detected