Skip to content

git: Document resolving references doesn't verify object existence

Patrick Steinhardt requested to merge pks-git-resolve-object-existence into master

When passing a reference to git rev-parse, it'll resolve that reference to an object ID. That ID mustn't necessarily be a commit, in fact not even a tag, but could in fact be anything. The most interesting edge case is also that "anything" also includes "nothing". As a result, our use of ResolveRefish doesn't actually verify that any given object ID actually exists, but really only works at the reference-level.

While this behaviour actually makes sense, it certainly can be unexpected. So let's document this behaviour and show ways to actually resolve it to a certain object type, which will then also check for existence.

Merge request reports