| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
@jamill Would you have a moment to spare a second set of eyes here? I realize that you're not spending as much time with submodules these days, but you certainly still know more about them than I do. :) |
Sorry, something went wrong.
| * Look up the target commit in the submodule. | ||
| * If it isn't found then fetch and try again. | ||
| */ | ||
| if ((error = git_object_lookup(&target_commit, sub_repo, git_submodule_index_id(sm), GIT_OBJ_COMMIT)) < 0) { |
There was a problem hiding this comment.
Is there a specific error code that is returned when the target commit could not be found? Could we be more selective and only attempt to fetch for the not found error?
Sorry, something went wrong.
|
Looks OK to me - and I think this matches the expected behavior. I might also suggest updating the comments for this function to clarify that this will fetch if there are missing commits. Thanks! |
Sorry, something went wrong.
|
Thanks for the review! I restricted the fetch logic to the not found error, and changed the documenation comment to mention the new behavior. I also made a slight drive-by fix for a duplicate check in the clone side. I'm noticing now that submodule update has a -no-fetch flag. Maybe there should be a no_fetch flag in the submodule update options? Probably not a big deal though. |
Sorry, something went wrong.
I agree, that would be a really nice option. Is this something you want to tackle in this PR or do you want me to merge this and tackle this later? |
Sorry, something went wrong.
|
I guess that I should probably add it in this PR so that I don't forget it. I'll add it soon. |
Sorry, something went wrong.
|
I added the flag. I also made another small drive-by fix to the version used in the update options initializer. |
Sorry, something went wrong.
Good catch on that one. 👌 Thanks! |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
This fixes #3783. When submodule update doesn't find the target commit in the submodule, fetch from the default remote and then try to lookup the commit again.