1
0
mirror of https://github.com/git/git.git synced 2024-10-20 09:59:05 +02:00
git/builtin
Taylor Blau 14e7b8344f builtin/pack-objects.c: ignore missing links with --stdin-packs
When 'git pack-objects --stdin-packs' encounters a commit in a pack, it
marks it as a starting point of a best-effort reachability traversal
that is used to populate the name-hash of the objects listed in the
given packs.

The traversal expects that it should be able to walk the ancestors of
all commits in a pack without issue. Ordinarily this is the case, but it
is possible to having missing parents from an unreachable part of the
repository. In that case, we'd consider any missing objects in the
unreachable portion of the graph to be junk.

This should be handled gracefully: since the traversal is best-effort
(i.e., we don't strictly need to fill in all of the name-hash fields),
we should simply ignore any missing links.

This patch does that (by setting the 'ignore_missing_links' bit on the
rev_info struct), and ensures we don't regress in the future by adding a
test which demonstrates this case.

It is a little over-eager, since it will also ignore missing links in
reachable parts of the packs (which would indicate a corrupted
repository), but '--stdin-packs' is explicitly *not* about reachability.
So this step isn't making anything worse for a repository which contains
packs missing reachable objects (since we never drop objects with
'--stdin-packs').

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-03-19 11:19:29 -07:00
..
add.c
am.c
annotate.c
apply.c
archive.c
bisect--helper.c
blame.c
branch.c Merge branch 'ph/use-delete-refs' 2021-02-05 16:40:45 -08:00
bugreport.c
bundle.c
cat-file.c
check-attr.c
check-ignore.c
check-mailmap.c
check-ref-format.c
checkout-index.c
checkout.c
clean.c
clone.c Merge branch 'jt/clone-unborn-head' 2021-02-17 17:21:40 -08:00
column.c
commit-graph.c
commit-tree.c
commit.c
config.c
count-objects.c
credential-cache--daemon.c
credential-cache.c
credential-store.c
credential.c
describe.c
diff-files.c Merge branch 'tb/precompose-prefix-too' 2021-02-12 14:21:04 -08:00
diff-index.c
diff-tree.c
diff.c Merge branch 'tb/precompose-prefix-too' 2021-02-12 14:21:04 -08:00
difftool.c
env--helper.c
fast-export.c
fast-import.c
fetch-pack.c
fetch.c Merge branch 'jt/clone-unborn-head' 2021-02-17 17:21:40 -08:00
fmt-merge-msg.c
for-each-ref.c
for-each-repo.c
fsck.c
gc.c maintenance: incremental strategy runs pack-refs weekly 2021-02-09 23:09:29 -08:00
get-tar-commit-id.c
grep.c Merge branch 'mt/grep-cached-untracked' 2021-02-17 17:21:41 -08:00
hash-object.c
help.c
index-pack.c
init-db.c
interpret-trailers.c
log.c Merge branch 'js/range-diff-one-side-only' 2021-02-17 17:21:41 -08:00
ls-files.c
ls-remote.c
ls-tree.c
mailinfo.c
mailsplit.c
merge-base.c
merge-file.c
merge-index.c
merge-ours.c
merge-recursive.c
merge-tree.c
merge.c
mktag.c
mktree.c
multi-pack-index.c
mv.c
name-rev.c
notes.c
pack-objects.c builtin/pack-objects.c: ignore missing links with --stdin-packs 2021-03-19 11:19:29 -07:00
pack-redundant.c
pack-refs.c
patch-id.c
prune-packed.c
prune.c
pull.c
push.c
range-diff.c Merge branch 'js/range-diff-one-side-only' 2021-02-17 17:21:41 -08:00
read-tree.c
rebase.c
receive-pack.c
reflog.c reflog expire --stale-fix: be generous about missing objects 2021-02-11 09:21:52 -08:00
remote-ext.c
remote-fd.c
remote.c
repack.c builtin/repack.c: reword comment around pack-objects flags 2021-03-05 11:33:52 -08:00
replace.c
rerere.c
reset.c
rev-list.c
rev-parse.c
revert.c
rm.c
send-pack.c
shortlog.c
show-branch.c
show-index.c
show-ref.c
sparse-checkout.c
stash.c
stripspace.c
submodule--helper.c Merge branch 'tb/precompose-prefix-too' 2021-02-12 14:21:04 -08:00
symbolic-ref.c
tag.c Merge branch 'ph/use-delete-refs' 2021-02-05 16:40:45 -08:00
unpack-file.c
unpack-objects.c
update-index.c
update-ref.c
update-server-info.c
upload-archive.c
upload-pack.c
var.c
verify-commit.c
verify-pack.c
verify-tag.c
worktree.c
write-tree.c