lib/gitlab/search/found_blob.rb is using instance var unsafely
In lib/gitlab/search/found_blob.rb, we have the binary_path method and the @binary_path instance var.
-
Initializer intializes
@binary_pathor defaults tonil -
#binary_pathmethod sets and memoizes@binary_pathtoo -
#pathmethod uses@binary_pathivar directly.
Is it possible to have a bug where path returns different values depending on whether binary_path is called prior ?
See also discussion from !18470 (merged) should be addressed:
NB: This was a pre-existing issue even before !18470 (merged)
-
@tkuah started a discussion: (+3 comments) This is very odd.
@binary_pathcan be different things depending on what order one calls:-
binary_paththenpath -
paththenbinary_path
Do we know any reason why
pathis using the ivar@binary_pathinstead of usingbinary_path? -
Edited by Thong Kuah