Change method of setting remote (#8)

This commit is contained in:
Chris de Graaf 2017-10-14 10:22:53 +01:00
parent 17c05e9ed2
commit 0956dc87fb

View File

@ -53,11 +53,12 @@ function generate(
# Initialize the repo and configure it.
repo = LibGit2.init(temp_pkg_dir)
info("Initialized git repo at $temp_pkg_dir")
cfg = LibGit2.GitConfig(repo)
!isempty(t.gitconfig) && info("Applying git configuration")
LibGit2.with(LibGit2.GitConfig, repo) do cfg
for (key, val) in t.gitconfig
LibGit2.set!(cfg, key, val)
end
end
LibGit2.commit(repo, "Empty initial commit")
info("Made initial empty commit")
rmt = if ssh
@ -65,7 +66,8 @@ function generate(
else
"https://$(t.host)/$(t.user)/$pkg_name.jl"
end
LibGit2.set_remote_url(repo, rmt)
# We need to set the remote in a strange way, see #8.
close(LibGit2.GitRemote(repo, "origin", rmt))
info("Set remote origin to $rmt")
# Create the gh-pages branch if necessary.