forked from vercel/turborepo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(turborepo): SCM tests and renaming (vercel#4462)
### Description Added more testing to SCM and renamed variables to be more understandable (repo_root -> git_root, monorepo_root -> turbo_root) ### Testing Instructions Added tests on Rust side for deleting files and adding file to index.
- Loading branch information
1 parent
9a0fa8b
commit 1cbba83
Showing
7 changed files
with
449 additions
and
172 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,28 @@ | ||
// 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 ( | ||
"github.com/vercel/turbo/cli/internal/ffi" | ||
) | ||
|
||
// git implements operations on a git repository. | ||
type git struct { | ||
repoRoot string | ||
} | ||
|
||
// 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, monorepoRoot, fromCommit, toCommit) | ||
} | ||
|
||
func (g *git) PreviousContent(fromCommit string, filePath string) ([]byte, error) { | ||
return ffi.PreviousContent(g.repoRoot, 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
Oops, something went wrong.