MCPcopy Index your code
hub / github.com/jetify-com/devbox / Push

Function Push

internal/pullbox/git/push.go:19–40  ·  view source on GitHub ↗
(ctx context.Context, dir, url string)

Source from the content-addressed store, hash-verified

17const nothingToCommitErrorText = "nothing to commit"
18
19func Push(ctx context.Context, dir, url string) error {
20 defer trace.StartRegion(ctx, "Push").End()
21
22 tmpDir, err := fileutil.CreateDevboxTempDir()
23 if err != nil {
24 return err
25 }
26
27 if err := cloneGitHistory(url, tmpDir); err != nil {
28 return err
29 }
30
31 if err := fileutil.CopyAll(dir, tmpDir); err != nil {
32 return err
33 }
34
35 if err := createCommit(tmpDir); err != nil {
36 return err
37 }
38
39 return push(tmpDir)
40}
41
42func cloneGitHistory(url, dst string) error {
43 // See https://stackoverflow.com/questions/38999901/clone-only-the-git-directory-of-a-git-repo

Callers 1

PushMethod · 0.92

Calls 6

CreateDevboxTempDirFunction · 0.92
CopyAllFunction · 0.92
cloneGitHistoryFunction · 0.85
createCommitFunction · 0.85
pushFunction · 0.85
EndMethod · 0.80

Tested by

no test coverage detected