Repository navigation
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
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.
Fixes #114 for overlapping paths within one invocation.
Passing both a directory and one of its files schedules concurrent
addLicensecalls for the same file. A worker can read the file after another worker truncates it, then replace the source with a header or a partial read. Normalize paths to cleaned absolute paths and deduplicate them before starting workers.Add a CLI subprocess regression that mixes directory, relative-file, and absolute-file inputs. It verifies one modification, one header, and preservation of the complete original source. Against the original implementation, all five runs modified the file 10–30 times; four also corrupted the source. The patched implementation passes 20 repeated runs and five runs with the race detector.
Validation on Windows with Go 1.23.0:
go test -run TestOverlappingPaths -count=20 -v— passed.go test -race -run TestOverlappingPaths -count=5— passed.go test -skip 'Test(Read|Write)Errors' -v ./...— passed, with the repository’s original LF fixture bytes. The two existing chmod-based permission tests were excluded because chmod is unavailable in this Windows environment.go vet ./..., build, gofmt, andgit diff --check— passed.The Linux CI matrix remains to be run upstream.