mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-12 12:55:47 +02:00
Rename Name to Path in File and CommitFile
Name was very confusing and misleading.
This commit is contained in:
parent
0b5504aa98
commit
2dfc3491bd
22 changed files with 217 additions and 218 deletions
|
@ -83,7 +83,7 @@ func TestWorkingTreeDiscardAllFileChanges(t *testing.T) {
|
|||
{
|
||||
testName: "An error occurred when resetting",
|
||||
file: &models.File{
|
||||
Name: "test",
|
||||
Path: "test",
|
||||
HasStagedChanges: true,
|
||||
},
|
||||
removeFile: func(string) error { return nil },
|
||||
|
@ -94,7 +94,7 @@ func TestWorkingTreeDiscardAllFileChanges(t *testing.T) {
|
|||
{
|
||||
testName: "An error occurred when removing file",
|
||||
file: &models.File{
|
||||
Name: "test",
|
||||
Path: "test",
|
||||
Tracked: false,
|
||||
Added: true,
|
||||
},
|
||||
|
@ -107,7 +107,7 @@ func TestWorkingTreeDiscardAllFileChanges(t *testing.T) {
|
|||
{
|
||||
testName: "An error occurred with checkout",
|
||||
file: &models.File{
|
||||
Name: "test",
|
||||
Path: "test",
|
||||
Tracked: true,
|
||||
HasStagedChanges: false,
|
||||
},
|
||||
|
@ -119,7 +119,7 @@ func TestWorkingTreeDiscardAllFileChanges(t *testing.T) {
|
|||
{
|
||||
testName: "Checkout only",
|
||||
file: &models.File{
|
||||
Name: "test",
|
||||
Path: "test",
|
||||
Tracked: true,
|
||||
HasStagedChanges: false,
|
||||
},
|
||||
|
@ -131,7 +131,7 @@ func TestWorkingTreeDiscardAllFileChanges(t *testing.T) {
|
|||
{
|
||||
testName: "Reset and checkout staged changes",
|
||||
file: &models.File{
|
||||
Name: "test",
|
||||
Path: "test",
|
||||
Tracked: true,
|
||||
HasStagedChanges: true,
|
||||
},
|
||||
|
@ -144,7 +144,7 @@ func TestWorkingTreeDiscardAllFileChanges(t *testing.T) {
|
|||
{
|
||||
testName: "Reset and checkout merge conflicts",
|
||||
file: &models.File{
|
||||
Name: "test",
|
||||
Path: "test",
|
||||
Tracked: true,
|
||||
HasMergeConflicts: true,
|
||||
},
|
||||
|
@ -157,7 +157,7 @@ func TestWorkingTreeDiscardAllFileChanges(t *testing.T) {
|
|||
{
|
||||
testName: "Reset and remove",
|
||||
file: &models.File{
|
||||
Name: "test",
|
||||
Path: "test",
|
||||
Tracked: false,
|
||||
Added: true,
|
||||
HasStagedChanges: true,
|
||||
|
@ -173,7 +173,7 @@ func TestWorkingTreeDiscardAllFileChanges(t *testing.T) {
|
|||
{
|
||||
testName: "Remove only",
|
||||
file: &models.File{
|
||||
Name: "test",
|
||||
Path: "test",
|
||||
Tracked: false,
|
||||
Added: true,
|
||||
HasStagedChanges: false,
|
||||
|
@ -220,7 +220,7 @@ func TestWorkingTreeDiff(t *testing.T) {
|
|||
{
|
||||
testName: "Default case",
|
||||
file: &models.File{
|
||||
Name: "test.txt",
|
||||
Path: "test.txt",
|
||||
HasStagedChanges: false,
|
||||
Tracked: true,
|
||||
},
|
||||
|
@ -235,7 +235,7 @@ func TestWorkingTreeDiff(t *testing.T) {
|
|||
{
|
||||
testName: "cached",
|
||||
file: &models.File{
|
||||
Name: "test.txt",
|
||||
Path: "test.txt",
|
||||
HasStagedChanges: false,
|
||||
Tracked: true,
|
||||
},
|
||||
|
@ -250,7 +250,7 @@ func TestWorkingTreeDiff(t *testing.T) {
|
|||
{
|
||||
testName: "plain",
|
||||
file: &models.File{
|
||||
Name: "test.txt",
|
||||
Path: "test.txt",
|
||||
HasStagedChanges: false,
|
||||
Tracked: true,
|
||||
},
|
||||
|
@ -265,7 +265,7 @@ func TestWorkingTreeDiff(t *testing.T) {
|
|||
{
|
||||
testName: "File not tracked and file has no staged changes",
|
||||
file: &models.File{
|
||||
Name: "test.txt",
|
||||
Path: "test.txt",
|
||||
HasStagedChanges: false,
|
||||
Tracked: false,
|
||||
},
|
||||
|
@ -280,7 +280,7 @@ func TestWorkingTreeDiff(t *testing.T) {
|
|||
{
|
||||
testName: "Default case (ignore whitespace)",
|
||||
file: &models.File{
|
||||
Name: "test.txt",
|
||||
Path: "test.txt",
|
||||
HasStagedChanges: false,
|
||||
Tracked: true,
|
||||
},
|
||||
|
@ -295,7 +295,7 @@ func TestWorkingTreeDiff(t *testing.T) {
|
|||
{
|
||||
testName: "Show diff with custom context size",
|
||||
file: &models.File{
|
||||
Name: "test.txt",
|
||||
Path: "test.txt",
|
||||
HasStagedChanges: false,
|
||||
Tracked: true,
|
||||
},
|
||||
|
@ -310,7 +310,7 @@ func TestWorkingTreeDiff(t *testing.T) {
|
|||
{
|
||||
testName: "Show diff with custom similarity threshold",
|
||||
file: &models.File{
|
||||
Name: "test.txt",
|
||||
Path: "test.txt",
|
||||
HasStagedChanges: false,
|
||||
Tracked: true,
|
||||
},
|
||||
|
@ -466,7 +466,7 @@ func TestWorkingTreeDiscardUnstagedFileChanges(t *testing.T) {
|
|||
scenarios := []scenario{
|
||||
{
|
||||
testName: "valid case",
|
||||
file: &models.File{Name: "test.txt"},
|
||||
file: &models.File{Path: "test.txt"},
|
||||
runner: oscommands.NewFakeRunner(t).
|
||||
ExpectGitArgs([]string{"checkout", "--", "test.txt"}, "", nil),
|
||||
test: func(err error) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue