Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "fix(turborepo): SCM tests and renaming (#4462)" #4604

Merged
merged 1 commit into from
Apr 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions cli/internal/ffi/ffi.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,15 +116,15 @@ func stringToRef(s string) *string {
}

// ChangedFiles returns the files changed in between two commits, the workdir and the index, and optionally untracked files
func ChangedFiles(gitRoot string, turboRoot string, fromCommit string, toCommit string) ([]string, error) {
func ChangedFiles(repoRoot string, monorepoRoot string, fromCommit string, toCommit string) ([]string, error) {
fromCommitRef := stringToRef(fromCommit)
toCommitRef := stringToRef(toCommit)

req := ffi_proto.ChangedFilesReq{
GitRoot: gitRoot,
FromCommit: fromCommitRef,
ToCommit: toCommitRef,
TurboRoot: turboRoot,
RepoRoot: repoRoot,
FromCommit: fromCommitRef,
ToCommit: toCommitRef,
MonorepoRoot: monorepoRoot,
}

reqBuf := Marshal(&req)
Expand All @@ -144,9 +144,9 @@ func ChangedFiles(gitRoot string, turboRoot string, fromCommit string, toCommit
}

// PreviousContent returns the content of a file at a previous commit
func PreviousContent(gitRoot, fromCommit, filePath string) ([]byte, error) {
func PreviousContent(repoRoot, fromCommit, filePath string) ([]byte, error) {
req := ffi_proto.PreviousContentReq{
GitRoot: gitRoot,
RepoRoot: repoRoot,
FromCommit: fromCommit,
FilePath: filePath,
}
Expand Down
176 changes: 88 additions & 88 deletions cli/internal/ffi/proto/messages.pb.go

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions cli/internal/scm/git_go.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
//go:build go || !rust
// +build go !rust

// Package scm abstracts operations on various tools like git
// Currently, only git is supported.
//
Expand Down
28 changes: 0 additions & 28 deletions cli/internal/scm/git_rust.go

This file was deleted.

8 changes: 4 additions & 4 deletions crates/turborepo-ffi/messages.proto
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ message GlobRespList {
}

message ChangedFilesReq {
string git_root = 1;
string turbo_root = 2;
string repo_root = 1;
string monorepo_root = 2;
optional string from_commit = 3;
string to_commit = 4;
optional string to_commit = 4;
}

message ChangedFilesResp {
Expand All @@ -42,7 +42,7 @@ message ChangedFilesList {
}

message PreviousContentReq {
string git_root = 1;
string repo_root = 1;
string from_commit = 2;
string file_path = 3;
}
Expand Down
10 changes: 5 additions & 5 deletions crates/turborepo-ffi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ pub extern "C" fn changed_files(buffer: Buffer) -> Buffer {
}
};

let commit_range = req.from_commit.as_deref().zip(req.to_commit.as_deref());
let response = match turborepo_scm::git::changed_files(
req.git_root.into(),
req.turbo_root.into(),
req.from_commit.as_deref(),
&req.to_commit,
req.repo_root.into(),
req.monorepo_root.into(),
commit_range,
) {
Ok(files) => {
let files: Vec<_> = files.into_iter().collect();
Expand Down Expand Up @@ -108,7 +108,7 @@ pub extern "C" fn previous_content(buffer: Buffer) -> Buffer {
};

let response = match turborepo_scm::git::previous_content(
req.git_root.into(),
req.repo_root.into(),
&req.from_commit,
PathBuf::from(req.file_path),
) {
Expand Down
Loading