Commit b5f52f3
sha1_file: freshen pack objects before loose
When writing out an object file, we first check whether it
already exists and if so optimize out the write. Prior to
33d4221, we did this by calling has_sha1_file(), which will
check for packed objects followed by loose. Since that
commit, we check loose objects first.
For the common case of a repository whose objects are mostly
packed, this means we will make a lot of extra access()
system calls checking for loose objects. We should follow
the same packed-then-loose order that all of our other
lookups use.
Reported-by: Stefan Saasen <[email protected]>
Signed-off-by: Jeff King <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>1 parent 1385bb7 commit b5f52f3
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3014 | 3014 | | |
3015 | 3015 | | |
3016 | 3016 | | |
3017 | | - | |
| 3017 | + | |
3018 | 3018 | | |
3019 | 3019 | | |
3020 | 3020 | | |
| |||
0 commit comments