-
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.
Revert "Revert rust scm usage (#4277)"
This reverts commit 995aae2.
- Loading branch information
1 parent
1fb6062
commit cbfc563
Showing
2 changed files
with
31 additions
and
0 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
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) | ||
} |