Skip to content
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 LGitRemote>>defaultBranchName (again) #8

Closed

Conversation

tinchodias
Copy link

This is a revamp of old pharo-vcs#40

akgrant43 and others added 30 commits December 13, 2019 17:57
1. Pass a ByteArray as the return buffer instead of String in #hexString.
Using a String works in Squeak FFI as the result is guaranteed to be ascii, but it is bad practice in general.
In Threaded FFI Strings are utf8 encoded and then passed in a buffer that is discarded after the call completes, i.e. they can't be used to return values (which is good since the decoding hasn't been done).
2. Use git_oid_nfmt() instead of git_oid_fmt().  The latter is suspectable to buffer overruns, which will corrupt object memory.
…sage_encoding:message:tree:parent_count:parents: parent_count

parent_count is currently defined as an int, which is signed 32 bits.

As documented at https://libgit2.org/libgit2/#HEAD/group/commit/git_commit_create it is actually a size_t, which is unsigned 64 bits on a 64 bit platform.

In Squeak FFI this doesn't seem to matter, presumably it zero outs the top half when transferred as a 64 bit value, however Threaded FFI doesn't appear to do this.  The result is that git commits will occasionally crash the VM when using Threaded FFI.

Modify the function signature to use size_t.

Fixes: pharo-project/pharo#5592
LGitCommitBuilder>>commit_create:repo:update_ref:author:committer:mes…
LGitSignature: Answer #name and #email using  #readStringUTF8 instead…
Extract code to LGitCommit>>parentAt:
Read global git config strings using utf8 encoding
LGitReadStream (rawBuffer)
LGitExternalObject (LibraryHandle Session)
guillep and others added 28 commits September 6, 2022 12:51
categorize class side of LGitMessageDecoder
More robust credential callback
…ffHunk-classinitialize

Fix small lint issue in LGitDiffHunk class>>#initialize
@tinchodias
Copy link
Author

Sorry, I wanted to do it to pharo-vcs!

@tinchodias tinchodias closed this Dec 25, 2022
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.

10 participants