Skip to content

Conversation

@silverweed
Copy link
Contributor

@silverweed silverweed commented Nov 26, 2025

Currently this doesn't work as expected:

auto dir1 = file->mkdir("a/b");
auto dir2 = file->mkdir("a/b", "", /* returnExisting = */ true); // should return the already-existing dir
EXPECT_EQ(dir1, dir2); // FAILS: dir2 is nullptr

because TDirectoryFile::mkdir doesn't propagate the value of returnExistingDirectory to recursive mkdir calls. This PR fixes it.

In addition, title was currently only applied to the topmost directory in case of hierarchies, which is counterintuitive as the returned TDirectory is actually the innermost. This PR changes the (previously undocumented) title logic to the opposite: every non-leaf directory gets created with a default title and only the innermost gets the user-defined one. In our codebase we have 0 cases of mkdir being called with a hierarchy and an explicit title, so this change shouldn't impact anything.

Checklist:

  • tested changes locally
  • updated the docs (if necessary)

@silverweed silverweed self-assigned this Nov 26, 2025
@silverweed silverweed requested a review from pcanal as a code owner November 26, 2025 10:38
@silverweed silverweed mentioned this pull request Nov 26, 2025
2 tasks
@github-actions
Copy link

Test Results

    22 files      22 suites   4d 2h 29m 4s ⏱️
 3 780 tests  3 780 ✅ 0 💤 0 ❌
81 234 runs  81 234 ✅ 0 💤 0 ❌

Results for commit bcfe688.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant