-
Notifications
You must be signed in to change notification settings - Fork 34
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
possibly fix #101 #104
possibly fix #101 #104
Conversation
@@ -77,8 +77,17 @@ function publish(branch::AbstractString, prbranch::AbstractString="") | |||
m !== nothing && ismatch(Base.VERSION_REGEX, m.captures[2]) || continue | |||
pkg, ver = m.captures; ver = convert(VersionNumber,ver) | |||
sha1 = readchomp(joinpath(metapath,path)) | |||
old = LibGit2.cat(repo, LibGit2.GitBlob, "origin/$branch:$path") | |||
old !== nothing && old != sha1 && throw(PkgError("$pkg v$ver SHA1 changed in METADATA – refusing to publish")) | |||
if VERSION < v"0.6-" |
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.
Is it possible to be more specific with the version?
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.
probably not, a lot of stuff has changed.
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.
when did this specifically change to throwing?
Didn't we have a find or search command for a similar replacement in base? This kind of thing is why we need to return "not found" from API's instead of putting try-catches everywhere. |
Agreed, but that's a lot more work which might not get done before 0.6. |
I thought there was an alternative you switched to when something similar came up in a base PR? |
There was this: JuliaLang/julia#20433, but I changed it to check the index instead of the commit (which I don't think will work in this case). Another option is to change the behaviour of |
I'm fairly sure this will fix #101.
Okay, it's not the prettiest code, but it should make do until we have a better solution to the problem of querying whether or not an object exists (which might be hard to do now in Base due to the feature freeze).