Skip to content

Commit

Permalink
create uniq dir when cloning repo (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsirianni authored Nov 19, 2024
1 parent 9210fa3 commit 2c72edf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/repo/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ func CloneRepo(cloneURL, branch, token string) (*git.Repository, error) {
ctx, cancel := context.WithTimeout(context.Background(), time.Second*120)
defer cancel()

repo, err := git.PlainCloneContext(ctx, "./out_repo", false, &git.CloneOptions{
dir := fmt.Sprintf("%s/%s-%d", os.TempDir(), branch, time.Now().Unix())

repo, err := git.PlainCloneContext(ctx, dir, false, &git.CloneOptions{
URL: cloneURL,
Progress: os.Stdout,
SingleBranch: true,
Expand Down

0 comments on commit 2c72edf

Please sign in to comment.