-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(turborepo): Switching back to git command instead of git2 (#4606)
### Description Once #4604 is merged and we release 1.9.2, we can merge this with additional tests ### Testing Instructions Added test for shallow cloned repo that fails on main
- Loading branch information
1 parent
636f584
commit 9c6221b
Showing
9 changed files
with
517 additions
and
256 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Package scm abstracts operations on various tools like git | ||
// Currently, only git is supported. | ||
// | ||
// Adapted from https://github.com/thought-machine/please/tree/master/src/scm | ||
// Copyright Thought Machine, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
//go:build rust | ||
// +build rust | ||
|
||
package scm | ||
|
||
import ( | ||
"fmt" | ||
"github.com/vercel/turbo/cli/internal/ffi" | ||
"github.com/vercel/turbo/cli/internal/turbopath" | ||
) | ||
|
||
// git implements operations on a git repository. | ||
type git struct { | ||
repoRoot turbopath.AbsoluteSystemPath | ||
} | ||
|
||
// ChangedFiles returns a list of modified files since the given commit, optionally including untracked files. | ||
func (g *git) ChangedFiles(fromCommit string, toCommit string, monorepoRoot string) ([]string, error) { | ||
return ffi.ChangedFiles(g.repoRoot.ToString(), monorepoRoot, fromCommit, toCommit) | ||
} | ||
|
||
func (g *git) PreviousContent(fromCommit string, filePath string) ([]byte, error) { | ||
if fromCommit == "" { | ||
return nil, fmt.Errorf("Need commit sha to inspect file contents") | ||
} | ||
|
||
return ffi.PreviousContent(g.repoRoot.ToString(), fromCommit, filePath) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.