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

Method translate

src/models/GitRefSpec.js:33–42  ·  view source on GitHub ↗
(remoteBranch)

Source from the content-addressed store, hash-verified

31 }
32
33 translate(remoteBranch) {
34 if (this.matchPrefix) {
35 if (remoteBranch.startsWith(this.remotePath)) {
36 return this.localPath + remoteBranch.replace(this.remotePath, '')
37 }
38 } else {
39 if (remoteBranch === this.remotePath) return this.localPath
40 }
41 return null
42 }
43
44 reverseTranslate(localBranch) {
45 if (this.matchPrefix) {

Calls

no outgoing calls

Tested by

no test coverage detected