Commit ae371bd
chunk-format.h: extract oid_version()
There are three definitions of an identical function which converts
`the_hash_algo` into either 1 (for SHA-1) or 2 (for SHA-256). There is a
copy of this function for writing both the commit-graph and
multi-pack-index file, and another inline definition used to write the
.rev header.
Consolidate these into a single definition in chunk-format.h. It's not
clear that this is the best header to define this function in, but it
should do for now.
(Worth noting, the .rev caller expects a 4-byte unsigned, but the other
two callers work with a single unsigned byte. The consolidated version
uses the latter type, and lets the compiler widen it when required).
Another caller will be added in a subsequent patch.
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>1 parent f954461 commit ae371bd
File tree
5 files changed
+23
-43
lines changed5 files changed
+23
-43
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
65 | 66 | | |
66 | 67 | | |
67 | 68 | | |
| 69 | + | |
| 70 | + | |
68 | 71 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | 196 | | |
209 | 197 | | |
210 | 198 | | |
| |||
365 | 353 | | |
366 | 354 | | |
367 | 355 | | |
368 | | - | |
| 356 | + | |
369 | 357 | | |
370 | | - | |
| 358 | + | |
371 | 359 | | |
372 | 360 | | |
373 | 361 | | |
| |||
1911 | 1899 | | |
1912 | 1900 | | |
1913 | 1901 | | |
1914 | | - | |
| 1902 | + | |
1915 | 1903 | | |
1916 | 1904 | | |
1917 | 1905 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | 44 | | |
57 | 45 | | |
58 | 46 | | |
| |||
134 | 122 | | |
135 | 123 | | |
136 | 124 | | |
137 | | - | |
| 125 | + | |
138 | 126 | | |
139 | | - | |
| 127 | + | |
140 | 128 | | |
141 | 129 | | |
142 | 130 | | |
| |||
420 | 408 | | |
421 | 409 | | |
422 | 410 | | |
423 | | - | |
| 411 | + | |
424 | 412 | | |
425 | 413 | | |
426 | 414 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
181 | 182 | | |
182 | 183 | | |
183 | 184 | | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | 185 | | |
197 | 186 | | |
198 | | - | |
| 187 | + | |
199 | 188 | | |
200 | 189 | | |
201 | 190 | | |
| |||
0 commit comments