diff options
author | Martin Ågren <martin.agren@gmail.com> | 2018-04-21 00:12:31 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-04-21 12:43:40 +0900 |
commit | be011bbe001facf71bd636494eb253aa5151d26a (patch) | |
tree | fd5252a98f4a1d79c5a73213edc6a88f0e4a1fc1 /Documentation/git-mktag.txt | |
parent | Git 2.16.3 (diff) | |
download | tgif-be011bbe001facf71bd636494eb253aa5151d26a.tar.xz |
fast-export: fix regression skipping some merge-commits
7199203937 (object_array: add and use `object_array_pop()`, 2017-09-23)
noted that the pattern `object = array.objects[--array.nr].item` could
be abstracted as `object = object_array_pop(&array)`.
Unfortunately, one of the conversions was horribly wrong. Between
grabbing the last object (i.e., peeking at it) and decreasing the object
count, the original code would sometimes return early. The updated code
on the other hand, will always pop the last element, then maybe do the
early return without doing anything with the object.
The end result is that merge commits where all the parents have still
not been exported will simply be dropped, meaning that they will be
completely missing from the exported data.
Re-add a commit when it is not yet time to handle it. An alternative
that was considered was to peek-then-pop. That carries some risk with it
since the peeking and popping need to act on the same object, in a
concerted fashion.
Add a test that would have caught this.
Reported-by: Isaac Chou <Isaac.Chou@microfocus.com>
Analyzed-by: Isaac Chou <Isaac.Chou@microfocus.com>
Helped-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/git-mktag.txt')
0 files changed, 0 insertions, 0 deletions