-
Notifications
You must be signed in to change notification settings - Fork 540
fix "reference delta not found" when cloning from aws codecommit #1086
base: master
Are you sure you want to change the base?
Conversation
Thanks for the patch! @kcburge, are you able to iterate over all the objects after that change? I believe this change fixes index creation but there may be more problems. |
I have not thoroughly tested the cloned repository. I am using this for
(currently) read only build automation. I have yet to try to make any
changes to the cloned repo. Haven't even tested subsequent pull either.
I don't know the inner workings of git, but this was clearly a problem, so
I attempted the fix.
…On Thu, Mar 14, 2019, 06:31 Javi Fontan ***@***.***> wrote:
@kcburge <https://github.com/kcburge>, are you able to iterate over all
the objects after that change? I believe this change fixes index creation
but there may be more problems.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1086 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAcc9SHApoTdn-HU_wVYf2dVwrdak2oHks5vWjL1gaJpZM4brATR>
.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe we don't have fixtures to test this case that would be good to have. Still this change looks good.
d131d7e
to
75032bb
Compare
I resolved the DCO issue. I apologize for not having time to resolve the codecov issue. |
@kcburge can you provide a test? |
I don't have anything to test with - I ran into this issue pulling from AWS codecommit (and not all repositories had this issue -- which is not invalid behavior of Git). It has been quite a while since I thought about this, but, from what I recall, the packfile objects parsed in order like this: Object 1 OBJ_BLOB Basically the second (and more) subsequent ref delta's referred to SHA1's that didn't exist until the prior ref deltas were resolved. I don't know how hard it would be to mock this data structure. Sorry I can't be more helpful at this time. |
What you can do upload to go-git-fixture a copy of the packfile or the capture the HTTP response to create a fixture. |
75032bb
to
b7346f9
Compare
The existing code does not handle the case where a ref delta refers to another
deltified object. Once the "parent" was undeltified, not attempt was made to
resolve references to that object's SHA1.
This change simply checks to see if there is an ExternalRef to the object just
resolved, and if so, replaces it and adopts its children.
I'm not an expert in the bowels of git, but this fixed my inability to clone
from codecommit.