Skip to content

Commit 2082d43

Browse files
authored
Merge pull request #142 from JuliaLang/sb/fixcat
Fix #101 again
2 parents c648209 + a554ee8 commit 2082d43

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/entry.jl

+11-2
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,17 @@ function publish(branch::AbstractString, prbranch::AbstractString="")
7373
m !== nothing && occursin(Base.VERSION_REGEX, m.captures[2]) || continue
7474
pkg, ver = m.captures; ver = VersionNumber(ver)
7575
sha1 = readchomp(joinpath(metapath,path))
76-
old = LibGit2.content(LibGit2.GitBlob(repo, "origin/$branch:$path"))
77-
old !== nothing && old != sha1 && throw(Pkg.PkgError("$pkg v$ver SHA1 changed in METADATA – refusing to publish"))
76+
try
77+
old = LibGit2.content(LibGit2.GitBlob(repo, "origin/$branch:$path"))
78+
if old != sha1
79+
throw(Pkg.PkgError("$pkg v$ver SHA1 changed in METADATA – refusing to publish"))
80+
end
81+
catch e
82+
if !(e isa LibGit2.GitError && e.code == LibGit2.Error.ENOTFOUND)
83+
rethrow(e)
84+
end
85+
end
86+
7887
with(LibGit2.GitRepo, PkgDev.dir(pkg)) do pkg_repo
7988
tag_name = "v$ver"
8089
tag_commit = LibGit2.revparseid(pkg_repo, "$(tag_name)^{commit}")

0 commit comments

Comments
 (0)