* 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 })
| 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. |
no test coverage detected