Skip to content

Commit

Permalink
Add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
fmeum committed Aug 19, 2024
1 parent 9f39942 commit 82eeac0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,9 @@ public void writeEntry(
@Nullable PathFragment symlinkTarget)
throws IOException {
String rootRelativePathString = rootRelativePath.getPathString();
// Source paths with spaces require escaping. Target paths with spaces don't as consumers
// are expected to split on the first space (without escaping) or after the part indicated
// by the length prefix (with escaping).
if (rootRelativePathString.indexOf(' ') != -1) {
manifestWriter.append(' ');
manifestWriter.append(String.valueOf(rootRelativePathString.length()));
Expand Down
1 change: 1 addition & 0 deletions src/test/shell/bazel/bazel_determinism_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ function hash_outputs() {
}

function test_determinism() {
# Verify that Bazel can build itself under a path with spaces.
local workdir="${TEST_TMPDIR}/work dir"
mkdir "${workdir}" || fail "Could not create work directory"
cd "${workdir}" || fail "Could not change to work directory"
Expand Down
3 changes: 2 additions & 1 deletion tools/java/runfiles/Runfiles.java
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,10 @@ public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof RepoMappingKey that)) {
if (o == null || !(o instanceof RepoMappingKey)) {
return false;
}
RepoMappingKey that = (RepoMappingKey) o;
return sourceRepo.equals(that.sourceRepo)
&& targetRepoApparentName.equals(that.targetRepoApparentName);
}
Expand Down

0 comments on commit 82eeac0

Please sign in to comment.