Commit 02a1026
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 870e719 commit 02a1026
3 files changed
Lines changed: 21 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1048 | 1048 | | |
1049 | 1049 | | |
1050 | 1050 | | |
1051 | | - | |
| 1051 | + | |
| 1052 | + | |
1052 | 1053 | | |
1053 | 1054 | | |
1054 | 1055 | | |
1055 | 1056 | | |
1056 | 1057 | | |
1057 | 1058 | | |
1058 | 1059 | | |
1059 | | - | |
| 1060 | + | |
| 1061 | + | |
1060 | 1062 | | |
1061 | 1063 | | |
1062 | 1064 | | |
| |||
1072 | 1074 | | |
1073 | 1075 | | |
1074 | 1076 | | |
1075 | | - | |
| 1077 | + | |
1076 | 1078 | | |
1077 | 1079 | | |
1078 | 1080 | | |
| |||
2050 | 2052 | | |
2051 | 2053 | | |
2052 | 2054 | | |
2053 | | - | |
| 2055 | + | |
| 2056 | + | |
2054 | 2057 | | |
2055 | | - | |
| 2058 | + | |
2056 | 2059 | | |
2057 | 2060 | | |
2058 | 2061 | | |
| |||
2079 | 2082 | | |
2080 | 2083 | | |
2081 | 2084 | | |
2082 | | - | |
| 2085 | + | |
2083 | 2086 | | |
2084 | 2087 | | |
2085 | 2088 | | |
| |||
2099 | 2102 | | |
2100 | 2103 | | |
2101 | 2104 | | |
2102 | | - | |
| 2105 | + | |
2103 | 2106 | | |
2104 | 2107 | | |
2105 | 2108 | | |
| |||
| 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