Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat: upstream parity — Line.Truncated + file-content stream overload#8

Merged
diomonogatari merged 2 commits into
mainfrom
feat/file-content-overload-and-line-truncated
Jun 5, 2026
Merged

feat: upstream parity — Line.Truncated + file-content stream overload#8
diomonogatari merged 2 commits into
mainfrom
feat/file-content-overload-and-line-truncated

Conversation

@diomonogatari

Copy link
Copy Markdown
Owner

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": true on file lines that exceed the server's maximum line length when browsing a path. The Line model dropped that field, silently losing the signal. Now surfaced as bool? Truncated.
  • Update a file from a content stream (lvermeulen/Bitbucket.Net#29) — UpdateProjectRepositoryPathAsync only accepted a path to a file on disk, forcing callers with in-memory content to write a temp file first. Added a Stream content overload (for string content, wrap it in a MemoryStream). The file-on-disk overload now delegates to it, preserving the existing ArrayPool fast path. Non-breaking: the new Stream parameter is distinct from the existing string fileName, so overload resolution stays unambiguous and the existing signature is untouched.

Testing

  • ModelSerializationTestsLine truncated true / 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.
  • Full suite: 767 passing, Release build clean under TreatWarningsAsErrors, format gate (dotnet format whitespace + style) green.

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.
@diomonogatari diomonogatari merged commit 1a7bca6 into main Jun 5, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant