feat: upstream parity — Line.Truncated + file-content stream overload#8
Merged
diomonogatari merged 2 commits intoJun 5, 2026
Merged
Conversation
Bitbucket sets "truncated": true on file lines that exceed the server's maximum line length when browsing a repository path; the Line model dropped the field, silently losing that signal. Add bool? Truncated so callers can detect truncated content. Implements lvermeulen#30.
UpdateProjectRepositoryPathAsync only accepted a path to a file on disk, so callers holding in-memory content (e.g. an MCP server) had to write a temp file first. Add a Stream overload — for string content, wrap it in a MemoryStream. The file-on-disk overload now delegates to it, preserving the ArrayPool fast path. The new typed parameter (Stream vs string) keeps the overloads unambiguous and the existing signature unchanged. Implements lvermeulen#29.
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
Two small, high-value fixes carried over from still-open issues on the original
lvermeulen/Bitbucket.Net, both with full test coverage. We're the maintained fork, so we take the good suggestions and implement them properly.Changes
Line.Truncated(lvermeulen/Bitbucket.Net#30) — Bitbucket sets"truncated": trueon file lines that exceed the server's maximum line length when browsing a path. TheLinemodel dropped that field, silently losing the signal. Now surfaced asbool? Truncated.lvermeulen/Bitbucket.Net#29) —UpdateProjectRepositoryPathAsynconly accepted a path to a file on disk, forcing callers with in-memory content to write a temp file first. Added aStream contentoverload (for string content, wrap it in aMemoryStream). The file-on-disk overload now delegates to it, preserving the existingArrayPoolfast path. Non-breaking: the newStreamparameter is distinct from the existingstring fileName, so overload resolution stays unambiguous and the existing signature is untouched.Testing
ModelSerializationTests—Linetruncatedtrue/false/ absent (→null) / round-trip.RepositoryFileUpdateMockTests— stream and file overloads PUT the expected content/branch/message and return the commit; plus null-content, blank-path, and missing-file guard tests.TreatWarningsAsErrors, format gate (dotnet formatwhitespace + style) green.