fix(git): improve diff handling and code quality in GitDataStore#15
Merged
fix(git): improve diff handling and code quality in GitDataStore#15
Conversation
- Use getOldPath() for DELETE entries instead of getNewPath() - Support adding PREV_COMMIT_ID when not present in handler parameters - Scope git log to current commit ID in getRevCommit() - Replace string concatenation with parameterized logging - Simplify temp directory creation using Files.createTempDirectory() - Remove unused variable and redundant configMap.put() Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix incorrect path resolution for deleted files in diff processing and improve overall code quality in GitDataStore.
Changes Made
getOldPath()instead ofgetNewPath()forDiffEntry.ChangeType.DELETEentries, since deleted files have no new pathPREV_COMMIT_IDis not present in handler parameters, append it automatically so incremental crawling works on first runcurrentCommitIdtogit.log().add()ingetRevCommit()to ensure log is scoped to the correct commit{}) inlogger.warn()callsFiles.createTempDirectory()instead of manualcreateTempFile+ delete + mkdir sequenceisUpdateCommitIdvariable and redundantconfigMap.put(REPOSITORY, repository)callTesting
mvn compileBreaking Changes
getRevCommit()method signature now includesthrows IOException— subclasses overriding this method will need to update their signatureAdditional Notes
updateDataConfigchange enables seamless first-run behavior without requiring manualPREV_COMMIT_IDconfiguration