Commit 327dd3a
committed
sha1_file: when writing objects, skip the read_object_hook
If we are going to write an object there is no use in calling
the read object hook to get an object from a potentially remote
source. We would rather just write out the object and avoid the
potential round trip for an object that doesn't exist.
This change adds a flag to the check_and_freshen() and
freshen_loose_object() functions' signatures so that the hook
is bypassed when the functions are called before writing loose
objects. The check for a local object is still performed so we
don't overwrite something that has already been written to one
of the objects directories.
Based on a patch by Kevin Willford.
Signed-off-by: Johannes Schindelin <johasc@microsoft.com>1 parent 1a4a541 commit 327dd3a
3 files changed
+22
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1099 | 1099 | | |
1100 | 1100 | | |
1101 | 1101 | | |
1102 | | - | |
| 1102 | + | |
| 1103 | + | |
1103 | 1104 | | |
1104 | 1105 | | |
1105 | 1106 | | |
1106 | 1107 | | |
1107 | 1108 | | |
1108 | 1109 | | |
1109 | 1110 | | |
1110 | | - | |
| 1111 | + | |
| 1112 | + | |
1111 | 1113 | | |
1112 | 1114 | | |
1113 | 1115 | | |
| |||
1123 | 1125 | | |
1124 | 1126 | | |
1125 | 1127 | | |
1126 | | - | |
| 1128 | + | |
1127 | 1129 | | |
1128 | 1130 | | |
1129 | 1131 | | |
| |||
2230 | 2232 | | |
2231 | 2233 | | |
2232 | 2234 | | |
2233 | | - | |
| 2235 | + | |
| 2236 | + | |
2234 | 2237 | | |
2235 | | - | |
| 2238 | + | |
2236 | 2239 | | |
2237 | 2240 | | |
2238 | 2241 | | |
| |||
2326 | 2329 | | |
2327 | 2330 | | |
2328 | 2331 | | |
2329 | | - | |
| 2332 | + | |
2330 | 2333 | | |
2331 | 2334 | | |
2332 | 2335 | | |
| |||
2366 | 2369 | | |
2367 | 2370 | | |
2368 | 2371 | | |
2369 | | - | |
| 2372 | + | |
2370 | 2373 | | |
2371 | 2374 | | |
2372 | 2375 | | |
| |||
2387 | 2390 | | |
2388 | 2391 | | |
2389 | 2392 | | |
2390 | | - | |
| 2393 | + | |
2391 | 2394 | | |
2392 | 2395 | | |
2393 | 2396 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
111 | 115 | | |
112 | 116 | | |
113 | 117 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
26 | 33 | | |
27 | 34 | | |
0 commit comments