Skip to content

Commit

Permalink
Renamed repo_root -> git root, monorepo_root -> turbo_root. Added tes…
Browse files Browse the repository at this point in the history
…t for deleted file

and for file added to index
  • Loading branch information
NicholasLYang committed Apr 4, 2023
1 parent 1964076 commit 1fb6062
Show file tree
Hide file tree
Showing 6 changed files with 192 additions and 124 deletions.
2 changes: 1 addition & 1 deletion cli/cmd/turbo/version.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package main

const turboVersion = "1.8.9-canary.1"
const turboVersion = "1.9.0-canary.0"
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(repoRoot string, monorepoRoot string, fromCommit string, toCommit string) ([]string, error) {
func ChangedFiles(gitRoot string, turboRoot string, fromCommit string, toCommit string) ([]string, error) {
fromCommitRef := stringToRef(fromCommit)
toCommitRef := stringToRef(toCommit)

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

reqBuf := Marshal(&req)
Expand All @@ -144,9 +144,9 @@ func ChangedFiles(repoRoot string, monorepoRoot string, fromCommit string, toCom
}

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

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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

message ChangedFilesReq {
string repo_root = 1;
string monorepo_root = 2;
string git_root = 1;
string turbo_root = 2;
optional string from_commit = 3;
optional string to_commit = 4;
}
Expand All @@ -42,7 +42,7 @@ message ChangedFilesList {
}

message PreviousContentReq {
string repo_root = 1;
string git_root = 1;
string from_commit = 2;
string file_path = 3;
}
Expand Down

0 comments on commit 1fb6062

Please sign in to comment.