Commit 28d0788
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 <[email protected]>1 parent 4e30600 commit 28d0788
3 files changed
+22
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1187 | 1187 | | |
1188 | 1188 | | |
1189 | 1189 | | |
1190 | | - | |
| 1190 | + | |
| 1191 | + | |
1191 | 1192 | | |
1192 | 1193 | | |
1193 | 1194 | | |
1194 | 1195 | | |
1195 | 1196 | | |
1196 | 1197 | | |
1197 | 1198 | | |
1198 | | - | |
| 1199 | + | |
| 1200 | + | |
1199 | 1201 | | |
1200 | 1202 | | |
1201 | 1203 | | |
| |||
1211 | 1213 | | |
1212 | 1214 | | |
1213 | 1215 | | |
1214 | | - | |
| 1216 | + | |
1215 | 1217 | | |
1216 | 1218 | | |
1217 | 1219 | | |
| |||
2465 | 2467 | | |
2466 | 2468 | | |
2467 | 2469 | | |
2468 | | - | |
| 2470 | + | |
| 2471 | + | |
2469 | 2472 | | |
2470 | | - | |
| 2473 | + | |
2471 | 2474 | | |
2472 | 2475 | | |
2473 | 2476 | | |
| |||
2563 | 2566 | | |
2564 | 2567 | | |
2565 | 2568 | | |
2566 | | - | |
| 2569 | + | |
2567 | 2570 | | |
2568 | 2571 | | |
2569 | 2572 | | |
| |||
2625 | 2628 | | |
2626 | 2629 | | |
2627 | 2630 | | |
2628 | | - | |
| 2631 | + | |
2629 | 2632 | | |
2630 | 2633 | | |
2631 | 2634 | | |
| |||
2669 | 2672 | | |
2670 | 2673 | | |
2671 | 2674 | | |
2672 | | - | |
| 2675 | + | |
2673 | 2676 | | |
2674 | 2677 | | |
2675 | 2678 | | |
| |||
| 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