MCPcopy Create free account
hub / github.com/isomorphic-git/isomorphic-git / exists

Method exists

src/managers/GitRefManager.js:325–332  ·  view source on GitHub ↗

* Checks if a ref exists. * * @param {Object} args * @param {FSClient} args.fs - A file system implementation. * @param {string} [args.gitdir=join(dir, '.git')] - [required] The [git directory](dir-vs-gitdir.md) path * @param {string} args.ref - The ref to check. * @returns {Promis

({ fs, gitdir, ref })

Source from the content-addressed store, hash-verified

323 * @returns {Promise<boolean>} - True if the ref exists, false otherwise.
324 */
325 static async exists({ fs, gitdir, ref }) {
326 try {
327 await GitRefManager.expand({ fs, gitdir, ref })
328 return true
329 } catch (err) {
330 return false
331 }
332 }
333
334 /**
335 * Expands a ref to its full name.

Callers 6

isIgnoredMethod · 0.45
updateRemoteRefsMethod · 0.45
expandMethod · 0.45
getStashSHAMethod · 0.45
writeStashReflogEntryMethod · 0.45
readStashReflogsMethod · 0.45

Calls 1

expandMethod · 0.80

Tested by

no test coverage detected