MCPcopy Create free account
hub / github.com/OpenAtomFoundation/SmartIDE / GetRemoteName

Method GetRemoteName

cli/pkg/common/git.go:193–198  ·  view source on GitHub ↗
(repoDirPath string)

Source from the content-addressed store, hash-verified

191}
192
193func (g gitOperation) GetRemoteName(repoDirPath string) string {
194 output, _ := EXEC.CombinedOutput("git remote show", repoDirPath)
195 tmpArray := strings.Split(strings.TrimSpace(output), "\n")
196 remoteName := tmpArray[len(tmpArray)-1]
197 return remoteName
198}
199
200// 获取默认分支
201// e.g. git remote show $(git remote show|tail -1)|grep 'HEAD branch'|awk '{print $NF}'

Callers 2

SparseCheckoutMethod · 0.95
GetMainBranchNameMethod · 0.95

Calls 1

CombinedOutputMethod · 0.80

Tested by

no test coverage detected