MCPcopy Create free account
hub / github.com/remotemobprogramming/mob / cloneRepositoryWithSymlink

Function cloneRepositoryWithSymlink

mob_test.go:2406–2421  ·  view source on GitHub ↗
(path, gitDirectory, remoteDirectory string)

Source from the content-addressed store, hash-verified

2404}
2405
2406func cloneRepositoryWithSymlink(path, gitDirectory, remoteDirectory string) {
2407 cloneRepository(path, remoteDirectory)
2408 say.Debug(fmt.Sprintf("clonerepositorywithsymlink: move .git to %s and create symlink to it", gitDirectory))
2409 err := os.Rename(filepath.FromSlash(path+"/.git"), gitDirectory)
2410 if err != nil {
2411 say.Error("Could not move directory " + path + " to " + gitDirectory)
2412 say.Error(err.Error())
2413 return
2414 }
2415 err = os.Symlink(gitDirectory, filepath.FromSlash(path+"/.git"))
2416 if err != nil {
2417 say.Error("Could not create symlink from " + gitDirectory + " to " + path + "/.git")
2418 say.Error(err.Error())
2419 return
2420 }
2421}
2422
2423func cleanRepositoryWithSymlink(path, gitDirectory string) {
2424 cleanRepository(path)

Callers 1

createTestbedInFunction · 0.85

Calls 3

DebugFunction · 0.92
ErrorFunction · 0.92
cloneRepositoryFunction · 0.85

Tested by

no test coverage detected