-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix a bug where GitRepository.compareTrees()
operation is not cached.
#382
Conversation
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.
Nice work!
Motivation: Even if we enabled cache, `null` can be set to `GitRepository.cache` depending on how a `GitRepository` was initialized. If it was newly created, cache will be set properly. Otherwise, it won't be. Modifications: - Removed the `childArgs` from `DirectoryBasedStorageManager` and made its subtypes call `init()` method explicitly, so that it is less error-prone. - Added a test case that makes sure `GitRepository.cache` is non-null for both code path. Result: - `GitRepository.compareTrees()` operation is cached properly.
09422df
to
c068582
Compare
Codecov Report
@@ Coverage Diff @@
## master #382 +/- ##
============================================
- Coverage 67.08% 66.99% -0.09%
+ Complexity 2851 2848 -3
============================================
Files 315 315
Lines 11902 11903 +1
Branches 1280 1282 +2
============================================
- Hits 7984 7975 -9
- Misses 3151 3158 +7
- Partials 767 770 +3
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #382 +/- ##
============================================
- Coverage 67.08% 67.03% -0.05%
+ Complexity 2851 2850 -1
============================================
Files 315 315
Lines 11902 11903 +1
Branches 1280 1280
============================================
- Hits 7984 7979 -5
- Misses 3151 3160 +9
+ Partials 767 764 -3
Continue to review full report at Codecov.
|
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.
Still LGTM :-)
Motivation:
Even if we enabled cache,
null
can be set toGitRepository.cache
depending on how a
GitRepository
was initialized. If it was newlycreated, cache will be set properly. Otherwise, it won't be.
Modifications:
childArgs
fromDirectoryBasedStorageManager
and madeits subtypes call
init()
method explicitly, so that it is lesserror-prone.
GitRepository.cache
is non-nullfor both code path.
Result:
GitRepository.compareTrees()
operation is cached properly.