summaryrefslogtreecommitdiffstats
path: root/pkg/commands/git_commands/working_tree_test.go
diff options
context:
space:
mode:
authorpikomonde <32364823+pikomonde@users.noreply.github.com>2024-03-20 03:15:20 +0700
committerStefan Haller <stefan@haller-berlin.de>2024-04-12 08:33:47 +0200
commit84333eebc3be466b23627f6709ad6b000ddd21f1 (patch)
tree0dc30763a0afb5abeabbe051e0c17771f4670b67 /pkg/commands/git_commands/working_tree_test.go
parent7f6eea2a55ee6e17660c893a9322d743c5016caf (diff)
renaming variable to CommitHash
Diffstat (limited to 'pkg/commands/git_commands/working_tree_test.go')
-rw-r--r--pkg/commands/git_commands/working_tree_test.go24
1 files changed, 12 insertions, 12 deletions
diff --git a/pkg/commands/git_commands/working_tree_test.go b/pkg/commands/git_commands/working_tree_test.go
index 08255e247..435048072 100644
--- a/pkg/commands/git_commands/working_tree_test.go
+++ b/pkg/commands/git_commands/working_tree_test.go
@@ -397,18 +397,18 @@ func TestWorkingTreeShowFileDiff(t *testing.T) {
func TestWorkingTreeCheckoutFile(t *testing.T) {
type scenario struct {
- testName string
- commitSha string
- fileName string
- runner *oscommands.FakeCmdObjRunner
- test func(error)
+ testName string
+ commitHash string
+ fileName string
+ runner *oscommands.FakeCmdObjRunner
+ test func(error)
}
scenarios := []scenario{
{
- testName: "typical case",
- commitSha: "11af912",
- fileName: "test999.txt",
+ testName: "typical case",
+ commitHash: "11af912",
+ fileName: "test999.txt",
runner: oscommands.NewFakeRunner(t).
ExpectGitArgs([]string{"checkout", "11af912", "--", "test999.txt"}, "", nil),
test: func(err error) {
@@ -416,9 +416,9 @@ func TestWorkingTreeCheckoutFile(t *testing.T) {
},
},
{
- testName: "returns error if there is one",
- commitSha: "11af912",
- fileName: "test999.txt",
+ testName: "returns error if there is one",
+ commitHash: "11af912",
+ fileName: "test999.txt",
runner: oscommands.NewFakeRunner(t).
ExpectGitArgs([]string{"checkout", "11af912", "--", "test999.txt"}, "", errors.New("error")),
test: func(err error) {
@@ -432,7 +432,7 @@ func TestWorkingTreeCheckoutFile(t *testing.T) {
t.Run(s.testName, func(t *testing.T) {
instance := buildWorkingTreeCommands(commonDeps{runner: s.runner})
- s.test(instance.CheckoutFile(s.commitSha, s.fileName))
+ s.test(instance.CheckoutFile(s.commitHash, s.fileName))
s.runner.CheckForMissingCalls()
})
}