Commit 790086d
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 260d6a0 commit 790086d
3 files changed
+22
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1122 | 1122 | | |
1123 | 1123 | | |
1124 | 1124 | | |
1125 | | - | |
| 1125 | + | |
| 1126 | + | |
1126 | 1127 | | |
1127 | 1128 | | |
1128 | 1129 | | |
1129 | 1130 | | |
1130 | 1131 | | |
1131 | 1132 | | |
1132 | 1133 | | |
1133 | | - | |
| 1134 | + | |
| 1135 | + | |
1134 | 1136 | | |
1135 | 1137 | | |
1136 | 1138 | | |
| |||
1146 | 1148 | | |
1147 | 1149 | | |
1148 | 1150 | | |
1149 | | - | |
| 1151 | + | |
1150 | 1152 | | |
1151 | 1153 | | |
1152 | 1154 | | |
| |||
2218 | 2220 | | |
2219 | 2221 | | |
2220 | 2222 | | |
2221 | | - | |
| 2223 | + | |
| 2224 | + | |
2222 | 2225 | | |
2223 | | - | |
| 2226 | + | |
2224 | 2227 | | |
2225 | 2228 | | |
2226 | 2229 | | |
| |||
2314 | 2317 | | |
2315 | 2318 | | |
2316 | 2319 | | |
2317 | | - | |
| 2320 | + | |
2318 | 2321 | | |
2319 | 2322 | | |
2320 | 2323 | | |
| |||
2354 | 2357 | | |
2355 | 2358 | | |
2356 | 2359 | | |
2357 | | - | |
| 2360 | + | |
2358 | 2361 | | |
2359 | 2362 | | |
2360 | 2363 | | |
| |||
2375 | 2378 | | |
2376 | 2379 | | |
2377 | 2380 | | |
2378 | | - | |
| 2381 | + | |
2379 | 2382 | | |
2380 | 2383 | | |
2381 | 2384 | | |
| |||
| 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 | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
29 | 36 | | |
30 | 37 | | |
0 commit comments