-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add docs for blob.jl #22555
Add docs for blob.jl #22555
Changes from 1 commit
87ad13e
4cea271
2d298d3
7ac475f
569cb2f
8d12869
2562bba
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,9 +9,12 @@ end | |
|
||
Fetch the *raw* contents of the [`GitBlob`](@ref) `blob`. This is a read-only | ||
`Array` containing the contents of the blob, which may be binary or may be ASCII | ||
`String` data. | ||
`String` data. `rawcontent` will allow the user to load the raw binary data into | ||
the output `Array` and will not check to ensure it is a valid `String`, so errors | ||
may occur if the result is passed to functions which expect valid `String` data. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is the result an array or a string? if this is type stable and always array, then you won't be passing it directly to most String functions There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Counterpoint: just a few lines below, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the constructor yes, but not things that expect a String |
||
|
||
See also [`content`](@ref). | ||
See also [`content`](@ref), which *will* throw an error the content of the `blob` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. throw an error if the content |
||
is binary and not valid ASCII. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. does it error on unicode? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually I think it shouldn't, the libgit2 docs only refer to "printable characters" |
||
""" | ||
function rawcontent(blob::GitBlob) | ||
ptr = ccall((:git_blob_rawcontent, :libgit2), Ptr{UInt8}, (Ptr{Void},), blob.ptr) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does read only mean here? you can always write to julia arrays
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did the revised wording make this clearer?