-
-
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
LibGit2: tests & improvements #13417
Conversation
@@ -1,9 +1,12 @@ | |||
# This file is a part of Julia. License is MIT: http://julialang.org/license | |||
|
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.
this first whitespace is considered significant and will get added back in by the license-headers script
repo_path = joinpath(dir, "Example3") | ||
@test_throws LibGit2.Error.GitError LibGit2.clone(ssh_prefix*repo_url, repo_path) | ||
end | ||
catch ex |
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.
add a forced failure at the end of the try if it should always fail
While you're refactoring the tests, can you move any that require internet access either to pkg or a separate libgit2-online test file? we cant run those by default but can add them to travis and appveyor |
credentials
callbackcredentials
callback & libgit2 tests
finally | ||
remove_tmp_dir && rm(tmpdir, recursive=true) | ||
# test parameters | ||
repo_url = "github.com/JuliaLang/Example.jl" |
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.
cloning this requires net access, right? add libgit2-online to the travis and appveyor yml's
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.
I do not clone it here, it's used to setup remote reference only.
credentials
callback & libgit2 tests
Ready for review. |
checkout_tree(repo, btree) | ||
end | ||
if set_head | ||
# checout selected branch |
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.
checkout
…ctions: clone, fetch, push credential callback can handle payload added `fetch_refspecs` & `push_refspecs` funcs for remote reference added function for github credentials refined repo initialization tests fixed branch head switching added signature parameter for `tag_create` added checkout options as a parameter improved libgit2 tests & separated online reqired provide signature to avoid reading from git global configuration fixed tests to handle testing system with(out) a default git configuration fixed typos
if payload_ptr != C_NULL | ||
payload = unsafe_pointer_to_objref(payload_ptr) | ||
if isa(payload, AbstractPayload) | ||
username = isdefined(payload, :user) ? getfield(payload, :user) : "" |
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.
I feel that checking for specific field names for a given type should be wrapped in a generic function: user(::Payload)
, password(::Payload)
, isused(::Payload)
, etc.
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.
Good idea.
LibGit2: tests & improvements
|
PR provides following:
LibGit2
module (separated online part)AbstractPayload
type for various callback payloadsclone
,fetch
,push