diff --git a/pkg/integration/tests/commit/staged.go b/pkg/integration/tests/commit/staged.go index 80de2bca9..715bc0eb2 100644 --- a/pkg/integration/tests/commit/staged.go +++ b/pkg/integration/tests/commit/staged.go @@ -6,21 +6,21 @@ import ( ) var Staged = NewIntegrationTest(NewIntegrationTestArgs{ - Description: "Staging a couple files, going in the staged files menu and committing", + Description: "Staging a couple files, going in the staged files menu, unstaging a line then committing", ExtraCmdArgs: "", Skip: false, SetupConfig: func(config *config.AppConfig) {}, SetupRepo: func(shell *Shell) { - shell.CreateFile("myfile", "myfile content") - shell.CreateFile("myfile2", "myfile2 content") + shell. + CreateFile("myfile", "myfile content\nwith a second line"). + CreateFile("myfile2", "myfile2 content") }, Run: func(shell *Shell, input *Input, assert *Assert, keys config.KeybindingConfig) { assert.CommitCount(0) - input.PrimaryAction() - input.NextItem() input.PrimaryAction() input.Confirm() + input.PrimaryAction() input.PressKeys(keys.Files.CommitChanges) commitMessage := "my commit message" @@ -29,5 +29,6 @@ var Staged = NewIntegrationTest(NewIntegrationTestArgs{ assert.CommitCount(1) assert.MatchHeadCommitMessage(Equals(commitMessage)) + assert.CurrentWindowName("stagingSecondary") }, }) diff --git a/pkg/integration/tests/commit/unstaged.go b/pkg/integration/tests/commit/unstaged.go index 5dd396eec..aa8579e2b 100644 --- a/pkg/integration/tests/commit/unstaged.go +++ b/pkg/integration/tests/commit/unstaged.go @@ -6,20 +6,20 @@ import ( ) var Unstaged = NewIntegrationTest(NewIntegrationTestArgs{ - Description: "Staging a couple files, going in the unstaged files menu and committing", + Description: "Staging a couple files, going in the unstaged files menu, staging a line and committing", ExtraCmdArgs: "", Skip: false, SetupConfig: func(config *config.AppConfig) {}, SetupRepo: func(shell *Shell) { - shell.CreateFile("myfile", "myfile content") - shell.CreateFile("myfile2", "myfile2 content") + shell. + CreateFile("myfile", "myfile content\nwith a second line"). + CreateFile("myfile2", "myfile2 content") }, Run: func(shell *Shell, input *Input, assert *Assert, keys config.KeybindingConfig) { assert.CommitCount(0) - input.PrimaryAction() - input.NextItem() input.Confirm() + input.PrimaryAction() input.PressKeys(keys.Files.CommitChanges) commitMessage := "my commit message" @@ -28,5 +28,6 @@ var Unstaged = NewIntegrationTest(NewIntegrationTestArgs{ assert.CommitCount(1) assert.MatchHeadCommitMessage(Equals(commitMessage)) + assert.CurrentWindowName("staging") }, }) diff --git a/test/integration_new/commit/staged/expected/repo/.git_keep/index b/test/integration_new/commit/staged/expected/repo/.git_keep/index index 193a6619c..6ca933f52 100644 Binary files a/test/integration_new/commit/staged/expected/repo/.git_keep/index and b/test/integration_new/commit/staged/expected/repo/.git_keep/index differ diff --git a/test/integration_new/commit/staged/expected/repo/.git_keep/logs/HEAD b/test/integration_new/commit/staged/expected/repo/.git_keep/logs/HEAD index 40d31f9ee..277243a2e 100644 --- a/test/integration_new/commit/staged/expected/repo/.git_keep/logs/HEAD +++ b/test/integration_new/commit/staged/expected/repo/.git_keep/logs/HEAD @@ -1 +1 @@ -0000000000000000000000000000000000000000 ef3197feca3fdc5b9f0170f483c6ff138d5cf186 CI 1669566692 +0100 commit (initial): my commit message +0000000000000000000000000000000000000000 a0a4dfd8937f66345c93ee7ebf5f85d53e05e9e8 CI 1669569482 +0100 commit (initial): my commit message diff --git a/test/integration_new/commit/staged/expected/repo/.git_keep/logs/refs/heads/master b/test/integration_new/commit/staged/expected/repo/.git_keep/logs/refs/heads/master index 40d31f9ee..277243a2e 100644 --- a/test/integration_new/commit/staged/expected/repo/.git_keep/logs/refs/heads/master +++ b/test/integration_new/commit/staged/expected/repo/.git_keep/logs/refs/heads/master @@ -1 +1 @@ -0000000000000000000000000000000000000000 ef3197feca3fdc5b9f0170f483c6ff138d5cf186 CI 1669566692 +0100 commit (initial): my commit message +0000000000000000000000000000000000000000 a0a4dfd8937f66345c93ee7ebf5f85d53e05e9e8 CI 1669569482 +0100 commit (initial): my commit message diff --git a/test/integration_new/commit/staged/expected/repo/.git_keep/objects/2c/32ecbb77ddbbb0584ceae9316e290da7733327 b/test/integration_new/commit/staged/expected/repo/.git_keep/objects/2c/32ecbb77ddbbb0584ceae9316e290da7733327 new file mode 100644 index 000000000..75197c7e9 Binary files /dev/null and b/test/integration_new/commit/staged/expected/repo/.git_keep/objects/2c/32ecbb77ddbbb0584ceae9316e290da7733327 differ diff --git a/test/integration_new/commit/staged/expected/repo/.git_keep/objects/3a/e2df795236e3c84cb1faa242d3268838603515 b/test/integration_new/commit/staged/expected/repo/.git_keep/objects/3a/e2df795236e3c84cb1faa242d3268838603515 deleted file mode 100644 index 57198442f..000000000 Binary files a/test/integration_new/commit/staged/expected/repo/.git_keep/objects/3a/e2df795236e3c84cb1faa242d3268838603515 and /dev/null differ diff --git a/test/integration_new/commit/staged/expected/repo/.git_keep/objects/45/e15f2c1a4f47adeba3dbfc075e46a574f9b1fa b/test/integration_new/commit/staged/expected/repo/.git_keep/objects/45/e15f2c1a4f47adeba3dbfc075e46a574f9b1fa new file mode 100644 index 000000000..8a26026cd Binary files /dev/null and b/test/integration_new/commit/staged/expected/repo/.git_keep/objects/45/e15f2c1a4f47adeba3dbfc075e46a574f9b1fa differ diff --git a/test/integration_new/commit/staged/expected/repo/.git_keep/objects/97/04090f88911a4083ef7d5907e38b9f45e43b16 b/test/integration_new/commit/staged/expected/repo/.git_keep/objects/97/04090f88911a4083ef7d5907e38b9f45e43b16 deleted file mode 100644 index c4b48a2f0..000000000 Binary files a/test/integration_new/commit/staged/expected/repo/.git_keep/objects/97/04090f88911a4083ef7d5907e38b9f45e43b16 and /dev/null differ diff --git a/test/integration_new/commit/staged/expected/repo/.git_keep/objects/a0/a4dfd8937f66345c93ee7ebf5f85d53e05e9e8 b/test/integration_new/commit/staged/expected/repo/.git_keep/objects/a0/a4dfd8937f66345c93ee7ebf5f85d53e05e9e8 new file mode 100644 index 000000000..c03b37b1d --- /dev/null +++ b/test/integration_new/commit/staged/expected/repo/.git_keep/objects/a0/a4dfd8937f66345c93ee7ebf5f85d53e05e9e8 @@ -0,0 +1,2 @@ +xM +0]o/H~%PGJAoo fDd(9XkYq(`$glҕct٨mi4_fY8&2!$0Z:j>SW_Bm-0 \ No newline at end of file diff --git a/test/integration_new/commit/staged/expected/repo/.git_keep/objects/a4/de8e0658023fb43037b687b5052c1b5b2ab0c3 b/test/integration_new/commit/staged/expected/repo/.git_keep/objects/a4/de8e0658023fb43037b687b5052c1b5b2ab0c3 new file mode 100644 index 000000000..d746db209 Binary files /dev/null and b/test/integration_new/commit/staged/expected/repo/.git_keep/objects/a4/de8e0658023fb43037b687b5052c1b5b2ab0c3 differ diff --git a/test/integration_new/commit/staged/expected/repo/.git_keep/objects/ad/a5661567ddf0a64f589cad3cd0cffd7e79af99 b/test/integration_new/commit/staged/expected/repo/.git_keep/objects/ad/a5661567ddf0a64f589cad3cd0cffd7e79af99 deleted file mode 100644 index 98345f609..000000000 Binary files a/test/integration_new/commit/staged/expected/repo/.git_keep/objects/ad/a5661567ddf0a64f589cad3cd0cffd7e79af99 and /dev/null differ diff --git a/test/integration_new/commit/staged/expected/repo/.git_keep/objects/ef/3197feca3fdc5b9f0170f483c6ff138d5cf186 b/test/integration_new/commit/staged/expected/repo/.git_keep/objects/ef/3197feca3fdc5b9f0170f483c6ff138d5cf186 deleted file mode 100644 index 11512bf51..000000000 --- a/test/integration_new/commit/staged/expected/repo/.git_keep/objects/ef/3197feca3fdc5b9f0170f483c6ff138d5cf186 +++ /dev/null @@ -1,2 +0,0 @@ -xA -0E]$iDz1Fn?GyWWU QcX)._,N%Ct0i/[zm>xm'Uԝ}M0 \ No newline at end of file diff --git a/test/integration_new/commit/staged/expected/repo/.git_keep/refs/heads/master b/test/integration_new/commit/staged/expected/repo/.git_keep/refs/heads/master index b44143ba4..8aa84085c 100644 --- a/test/integration_new/commit/staged/expected/repo/.git_keep/refs/heads/master +++ b/test/integration_new/commit/staged/expected/repo/.git_keep/refs/heads/master @@ -1 +1 @@ -ef3197feca3fdc5b9f0170f483c6ff138d5cf186 +a0a4dfd8937f66345c93ee7ebf5f85d53e05e9e8 diff --git a/test/integration_new/commit/staged/expected/repo/myfile b/test/integration_new/commit/staged/expected/repo/myfile index ada566156..45e15f2c1 100644 --- a/test/integration_new/commit/staged/expected/repo/myfile +++ b/test/integration_new/commit/staged/expected/repo/myfile @@ -1 +1,2 @@ -myfile content \ No newline at end of file +myfile content +with a second line \ No newline at end of file diff --git a/test/integration_new/commit/staging/expected/repo/.git_keep/COMMIT_EDITMSG b/test/integration_new/commit/staging/expected/repo/.git_keep/COMMIT_EDITMSG deleted file mode 100644 index 8a744b4fe..000000000 --- a/test/integration_new/commit/staging/expected/repo/.git_keep/COMMIT_EDITMSG +++ /dev/null @@ -1 +0,0 @@ -my commit message diff --git a/test/integration_new/commit/staging/expected/repo/.git_keep/FETCH_HEAD b/test/integration_new/commit/staging/expected/repo/.git_keep/FETCH_HEAD deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/integration_new/commit/staging/expected/repo/.git_keep/HEAD b/test/integration_new/commit/staging/expected/repo/.git_keep/HEAD deleted file mode 100644 index cb089cd89..000000000 --- a/test/integration_new/commit/staging/expected/repo/.git_keep/HEAD +++ /dev/null @@ -1 +0,0 @@ -ref: refs/heads/master diff --git a/test/integration_new/commit/staging/expected/repo/.git_keep/MERGE_RR b/test/integration_new/commit/staging/expected/repo/.git_keep/MERGE_RR deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/integration_new/commit/staging/expected/repo/.git_keep/config b/test/integration_new/commit/staging/expected/repo/.git_keep/config deleted file mode 100644 index 2b89b8630..000000000 --- a/test/integration_new/commit/staging/expected/repo/.git_keep/config +++ /dev/null @@ -1,12 +0,0 @@ -[core] - repositoryformatversion = 0 - filemode = true - bare = false - logallrefupdates = true -[user] - email = CI@example.com - name = CI -[commit] - gpgSign = false -[protocol "file"] - allow = always diff --git a/test/integration_new/commit/staging/expected/repo/.git_keep/description b/test/integration_new/commit/staging/expected/repo/.git_keep/description deleted file mode 100644 index 498b267a8..000000000 --- a/test/integration_new/commit/staging/expected/repo/.git_keep/description +++ /dev/null @@ -1 +0,0 @@ -Unnamed repository; edit this file 'description' to name the repository. diff --git a/test/integration_new/commit/staging/expected/repo/.git_keep/index b/test/integration_new/commit/staging/expected/repo/.git_keep/index deleted file mode 100644 index 3c44f83b5..000000000 Binary files a/test/integration_new/commit/staging/expected/repo/.git_keep/index and /dev/null differ diff --git a/test/integration_new/commit/staging/expected/repo/.git_keep/info/exclude b/test/integration_new/commit/staging/expected/repo/.git_keep/info/exclude deleted file mode 100644 index a5196d1be..000000000 --- a/test/integration_new/commit/staging/expected/repo/.git_keep/info/exclude +++ /dev/null @@ -1,6 +0,0 @@ -# git ls-files --others --exclude-from=.git/info/exclude -# Lines that start with '#' are comments. -# For a project mostly in C, the following would be a good set of -# exclude patterns (uncomment them if you want to use them): -# *.[oa] -# *~ diff --git a/test/integration_new/commit/staging/expected/repo/.git_keep/logs/HEAD b/test/integration_new/commit/staging/expected/repo/.git_keep/logs/HEAD deleted file mode 100644 index 910749aff..000000000 --- a/test/integration_new/commit/staging/expected/repo/.git_keep/logs/HEAD +++ /dev/null @@ -1 +0,0 @@ -0000000000000000000000000000000000000000 28f8e24755d8792e66738e36f193949a68021709 CI 1669566470 +0100 commit (initial): my commit message diff --git a/test/integration_new/commit/staging/expected/repo/.git_keep/logs/refs/heads/master b/test/integration_new/commit/staging/expected/repo/.git_keep/logs/refs/heads/master deleted file mode 100644 index 910749aff..000000000 --- a/test/integration_new/commit/staging/expected/repo/.git_keep/logs/refs/heads/master +++ /dev/null @@ -1 +0,0 @@ -0000000000000000000000000000000000000000 28f8e24755d8792e66738e36f193949a68021709 CI 1669566470 +0100 commit (initial): my commit message diff --git a/test/integration_new/commit/staging/expected/repo/.git_keep/objects/28/f8e24755d8792e66738e36f193949a68021709 b/test/integration_new/commit/staging/expected/repo/.git_keep/objects/28/f8e24755d8792e66738e36f193949a68021709 deleted file mode 100644 index cc6a8ec73..000000000 Binary files a/test/integration_new/commit/staging/expected/repo/.git_keep/objects/28/f8e24755d8792e66738e36f193949a68021709 and /dev/null differ diff --git a/test/integration_new/commit/staging/expected/repo/.git_keep/objects/3a/e2df795236e3c84cb1faa242d3268838603515 b/test/integration_new/commit/staging/expected/repo/.git_keep/objects/3a/e2df795236e3c84cb1faa242d3268838603515 deleted file mode 100644 index 57198442f..000000000 Binary files a/test/integration_new/commit/staging/expected/repo/.git_keep/objects/3a/e2df795236e3c84cb1faa242d3268838603515 and /dev/null differ diff --git a/test/integration_new/commit/staging/expected/repo/.git_keep/objects/97/04090f88911a4083ef7d5907e38b9f45e43b16 b/test/integration_new/commit/staging/expected/repo/.git_keep/objects/97/04090f88911a4083ef7d5907e38b9f45e43b16 deleted file mode 100644 index c4b48a2f0..000000000 Binary files a/test/integration_new/commit/staging/expected/repo/.git_keep/objects/97/04090f88911a4083ef7d5907e38b9f45e43b16 and /dev/null differ diff --git a/test/integration_new/commit/staging/expected/repo/.git_keep/objects/ad/a5661567ddf0a64f589cad3cd0cffd7e79af99 b/test/integration_new/commit/staging/expected/repo/.git_keep/objects/ad/a5661567ddf0a64f589cad3cd0cffd7e79af99 deleted file mode 100644 index 98345f609..000000000 Binary files a/test/integration_new/commit/staging/expected/repo/.git_keep/objects/ad/a5661567ddf0a64f589cad3cd0cffd7e79af99 and /dev/null differ diff --git a/test/integration_new/commit/staging/expected/repo/.git_keep/refs/heads/master b/test/integration_new/commit/staging/expected/repo/.git_keep/refs/heads/master deleted file mode 100644 index 3bc6acf4d..000000000 --- a/test/integration_new/commit/staging/expected/repo/.git_keep/refs/heads/master +++ /dev/null @@ -1 +0,0 @@ -28f8e24755d8792e66738e36f193949a68021709 diff --git a/test/integration_new/commit/staging/expected/repo/myfile b/test/integration_new/commit/staging/expected/repo/myfile deleted file mode 100644 index ada566156..000000000 --- a/test/integration_new/commit/staging/expected/repo/myfile +++ /dev/null @@ -1 +0,0 @@ -myfile content \ No newline at end of file diff --git a/test/integration_new/commit/staging/expected/repo/myfile2 b/test/integration_new/commit/staging/expected/repo/myfile2 deleted file mode 100644 index 9704090f8..000000000 --- a/test/integration_new/commit/staging/expected/repo/myfile2 +++ /dev/null @@ -1 +0,0 @@ -myfile2 content \ No newline at end of file diff --git a/test/integration_new/commit/unstaged/expected/repo/.git_keep/index b/test/integration_new/commit/unstaged/expected/repo/.git_keep/index index 617e78b3a..e4b059071 100644 Binary files a/test/integration_new/commit/unstaged/expected/repo/.git_keep/index and b/test/integration_new/commit/unstaged/expected/repo/.git_keep/index differ diff --git a/test/integration_new/commit/unstaged/expected/repo/.git_keep/logs/HEAD b/test/integration_new/commit/unstaged/expected/repo/.git_keep/logs/HEAD index c2cf4bcdd..2889f13ff 100644 --- a/test/integration_new/commit/unstaged/expected/repo/.git_keep/logs/HEAD +++ b/test/integration_new/commit/unstaged/expected/repo/.git_keep/logs/HEAD @@ -1 +1 @@ -0000000000000000000000000000000000000000 d46951396fe8179592ec90aee0c0414fc0512fc5 CI 1669566705 +0100 commit (initial): my commit message +0000000000000000000000000000000000000000 109e5843c76c640d7075c2897b5720f1714df776 CI 1669569750 +0100 commit (initial): my commit message diff --git a/test/integration_new/commit/unstaged/expected/repo/.git_keep/logs/refs/heads/master b/test/integration_new/commit/unstaged/expected/repo/.git_keep/logs/refs/heads/master index c2cf4bcdd..2889f13ff 100644 --- a/test/integration_new/commit/unstaged/expected/repo/.git_keep/logs/refs/heads/master +++ b/test/integration_new/commit/unstaged/expected/repo/.git_keep/logs/refs/heads/master @@ -1 +1 @@ -0000000000000000000000000000000000000000 d46951396fe8179592ec90aee0c0414fc0512fc5 CI 1669566705 +0100 commit (initial): my commit message +0000000000000000000000000000000000000000 109e5843c76c640d7075c2897b5720f1714df776 CI 1669569750 +0100 commit (initial): my commit message diff --git a/test/integration_new/commit/unstaged/expected/repo/.git_keep/objects/00/e2463e8a06d3191bd825531e5dbf26bac22d6b b/test/integration_new/commit/unstaged/expected/repo/.git_keep/objects/00/e2463e8a06d3191bd825531e5dbf26bac22d6b new file mode 100644 index 000000000..5bdcb3903 Binary files /dev/null and b/test/integration_new/commit/unstaged/expected/repo/.git_keep/objects/00/e2463e8a06d3191bd825531e5dbf26bac22d6b differ diff --git a/test/integration_new/commit/unstaged/expected/repo/.git_keep/objects/0c/4369dfc55cd41da90e149f2fa8ee3fc0a8f297 b/test/integration_new/commit/unstaged/expected/repo/.git_keep/objects/0c/4369dfc55cd41da90e149f2fa8ee3fc0a8f297 deleted file mode 100644 index 79af4f45f..000000000 Binary files a/test/integration_new/commit/unstaged/expected/repo/.git_keep/objects/0c/4369dfc55cd41da90e149f2fa8ee3fc0a8f297 and /dev/null differ diff --git a/test/integration_new/commit/unstaged/expected/repo/.git_keep/objects/10/9e5843c76c640d7075c2897b5720f1714df776 b/test/integration_new/commit/unstaged/expected/repo/.git_keep/objects/10/9e5843c76c640d7075c2897b5720f1714df776 new file mode 100644 index 000000000..118e4d39c --- /dev/null +++ b/test/integration_new/commit/unstaged/expected/repo/.git_keep/objects/10/9e5843c76c640d7075c2897b5720f1714df776 @@ -0,0 +1,2 @@ +xK +0@]$ DzL2~!F[nJ3wH*5KIQt 1DA