Open hsablonniere opened 6 years ago
I'll probably get a convenience function that makes this easy later tonight or tomorrow, but if I don't it's relatively easy to work around:
import { readObject, resolveRef } from 'isomorphic-git'
function resolveCommit (oid) {
let { type, object } = await readObject({ gitdir, oid })
if (type === 'commit') return oid
// Recursively resolve annotated tags
if (type === 'tag') return resolveCommit(object.object)
// else
throw Error(`wow, seriously did not expect a ${type}` here)
}
let oid = resolveRef({ gitdir, ref })
oid = resolveCommit(oid)
^ completely untested. Because if I tested it then I'd probably have published it already.
FYI, I haven't gotten around to it. Been stuck on a stupid bug fighting with my CI system.
@wmhilton No worries...
Right now, with the new isomorphic-git based clever-tools, we cannot resolve the commit id of a tag. This is mandatory for us to call the API with the right commit id to restart.
We filed an issue and proposed a solution.
When this is available, we'll be able to add an option to
clever restart
called--tag
to call the API with the right SHA1 to restart.