diff options
author | brian m. carlson <sandals@crustytoothpaste.net> | 2020-05-21 02:07:11 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-05-21 09:55:21 -0700 |
commit | 81861288a987c6e05526526fa5dc74d2e2b80a5a (patch) | |
tree | 813f96efd91ec8059dda5ecaf5c4c3681ea00e4a /Documentation/RelNotes | |
parent | t0021: test filter metadata for additional cases (diff) | |
download | tgif-81861288a987c6e05526526fa5dc74d2e2b80a5a.tar.xz |
builtin/checkout: simplify metadata initialization
When we call init_checkout_metadata in reset_tree, we want to pass the
object ID of the commit in question so that it can be passed to filters,
or if there is no commit, the tree. We anticipated this latter case,
which can occur elsewhere in the checkout code, but it cannot occur
here. The only case in which we do not have a commit object is when
invoking git switch with --orphan. Moreover, we can only hit this code
path without a commit object additionally with either --force or
--discard-changes.
In such a case, there is no point initializing the checkout metadata
with a commit or tree because (a) there is no commit, only the empty
tree, and (b) we will never use the data, since no files will be smudged
when checking out a branch with no files. Pass the all-zeros object ID
in this case, since we just need some value which is a valid pointer.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Reviewed-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/RelNotes')
0 files changed, 0 insertions, 0 deletions