forked from jesseduffield/lazygit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request jesseduffield#1980 from ajhynes7/stash-untracked-c…
…hanges
- Loading branch information
Showing
47 changed files
with
182 additions
and
22 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
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
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,34 @@ | ||
package stash | ||
|
||
import ( | ||
"github.com/jesseduffield/lazygit/pkg/config" | ||
. "github.com/jesseduffield/lazygit/pkg/integration/components" | ||
) | ||
|
||
var Stash = NewIntegrationTest(NewIntegrationTestArgs{ | ||
Description: "Stashing files", | ||
ExtraCmdArgs: "", | ||
Skip: false, | ||
SetupConfig: func(config *config.AppConfig) {}, | ||
SetupRepo: func(shell *Shell) { | ||
shell.EmptyCommit("initial commit") | ||
shell.CreateFile("file", "content") | ||
shell.GitAddAll() | ||
}, | ||
Run: func(shell *Shell, input *Input, assert *Assert, keys config.KeybindingConfig) { | ||
assert.StashCount(0) | ||
assert.WorkingTreeFileCount(1) | ||
|
||
input.PressKeys(keys.Files.ViewStashOptions) | ||
assert.InMenu() | ||
|
||
input.PressKeys("a") | ||
assert.InPrompt() | ||
assert.MatchCurrentViewTitle(Equals("Stash changes")) | ||
|
||
input.Type("my stashed file") | ||
input.Confirm() | ||
assert.StashCount(1) | ||
assert.WorkingTreeFileCount(0) | ||
}, | ||
}) |
35 changes: 35 additions & 0 deletions
35
pkg/integration/tests/stash/stash_including_untracked_files.go
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,35 @@ | ||
package stash | ||
|
||
import ( | ||
"github.com/jesseduffield/lazygit/pkg/config" | ||
. "github.com/jesseduffield/lazygit/pkg/integration/components" | ||
) | ||
|
||
var StashIncludingUntrackedFiles = NewIntegrationTest(NewIntegrationTestArgs{ | ||
Description: "Stashing all files including untracked ones", | ||
ExtraCmdArgs: "", | ||
Skip: false, | ||
SetupConfig: func(config *config.AppConfig) {}, | ||
SetupRepo: func(shell *Shell) { | ||
shell.EmptyCommit("initial commit") | ||
shell.CreateFile("file_1", "content") | ||
shell.CreateFile("file_2", "content") | ||
shell.GitAdd("file_1") | ||
}, | ||
Run: func(shell *Shell, input *Input, assert *Assert, keys config.KeybindingConfig) { | ||
assert.StashCount(0) | ||
assert.WorkingTreeFileCount(2) | ||
|
||
input.PressKeys(keys.Files.ViewStashOptions) | ||
assert.InMenu() | ||
|
||
input.PressKeys("U") | ||
assert.InPrompt() | ||
assert.MatchCurrentViewTitle(Equals("Stash changes")) | ||
|
||
input.Type("my stashed file") | ||
input.Confirm() | ||
assert.StashCount(1) | ||
assert.WorkingTreeFileCount(0) | ||
}, | ||
}) |
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
1 change: 1 addition & 0 deletions
1
test/integration_new/stash/stash/expected/repo/.git_keep/COMMIT_EDITMSG
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 @@ | ||
initial commit |
Empty file.
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 @@ | ||
ref: refs/heads/master |
1 change: 1 addition & 0 deletions
1
test/integration_new/stash/stash/expected/repo/.git_keep/ORIG_HEAD
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 @@ | ||
e6ed7d5c2198fa4791de9c66e8000da607eaf9a3 |
12 changes: 12 additions & 0 deletions
12
test/integration_new/stash/stash/expected/repo/.git_keep/config
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,12 @@ | ||
[core] | ||
repositoryformatversion = 0 | ||
filemode = true | ||
bare = false | ||
logallrefupdates = true | ||
ignorecase = true | ||
precomposeunicode = true | ||
[user] | ||
email = [email protected] | ||
name = CI | ||
[commit] | ||
gpgSign = false |
1 change: 1 addition & 0 deletions
1
test/integration_new/stash/stash/expected/repo/.git_keep/description
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 @@ | ||
Unnamed repository; edit this file 'description' to name the repository. |
Binary file not shown.
6 changes: 6 additions & 0 deletions
6
test/integration_new/stash/stash/expected/repo/.git_keep/info/exclude
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,6 @@ | ||
# 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] | ||
# *~ |
2 changes: 2 additions & 0 deletions
2
test/integration_new/stash/stash/expected/repo/.git_keep/logs/HEAD
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,2 @@ | ||
0000000000000000000000000000000000000000 e6ed7d5c2198fa4791de9c66e8000da607eaf9a3 CI <[email protected]> 1668288675 -0330 commit (initial): initial commit | ||
e6ed7d5c2198fa4791de9c66e8000da607eaf9a3 e6ed7d5c2198fa4791de9c66e8000da607eaf9a3 CI <[email protected]> 1668288676 -0330 reset: moving to HEAD |
1 change: 1 addition & 0 deletions
1
test/integration_new/stash/stash/expected/repo/.git_keep/logs/refs/heads/master
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 @@ | ||
0000000000000000000000000000000000000000 e6ed7d5c2198fa4791de9c66e8000da607eaf9a3 CI <[email protected]> 1668288675 -0330 commit (initial): initial commit |
1 change: 1 addition & 0 deletions
1
test/integration_new/stash/stash/expected/repo/.git_keep/logs/refs/stash
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 @@ | ||
0000000000000000000000000000000000000000 c86eeda485a49ca608cb2617bb027be66cd92bc3 CI <[email protected]> 1668288676 -0330 On master: my stashed file |
Binary file added
BIN
+15 Bytes
...new/stash/stash/expected/repo/.git_keep/objects/4b/825dc642cb6eb9a060e54bf8d69288fbee4904
Binary file not shown.
Binary file added
BIN
+22 Bytes
...new/stash/stash/expected/repo/.git_keep/objects/6b/584e8ece562ebffc15d38808cd6b98fc3d97ea
Binary file not shown.
1 change: 1 addition & 0 deletions
1
...new/stash/stash/expected/repo/.git_keep/objects/b4/ba8c398d35c204cc9ae06e120c6f0801fd3f32
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 @@ | ||
x��Aj�0E��)� c�I��@V>�X3"��9~��l?�=^�Z���S�UA� H��drN�/)��r����a,s�X̃w];(���)Ák�DQ�0(����߷n|ߦ���=����@m����c=��~x7u}��B�߃������^y�?�yN�FY |
Binary file added
BIN
+191 Bytes
...new/stash/stash/expected/repo/.git_keep/objects/c8/6eeda485a49ca608cb2617bb027be66cd92bc3
Binary file not shown.
Binary file added
BIN
+49 Bytes
...new/stash/stash/expected/repo/.git_keep/objects/d9/1d06157bdc633d25f970b9cc54d0eb74fb850f
Binary file not shown.
Binary file added
BIN
+123 Bytes
...new/stash/stash/expected/repo/.git_keep/objects/e6/ed7d5c2198fa4791de9c66e8000da607eaf9a3
Binary file not shown.
1 change: 1 addition & 0 deletions
1
test/integration_new/stash/stash/expected/repo/.git_keep/refs/heads/master
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 @@ | ||
e6ed7d5c2198fa4791de9c66e8000da607eaf9a3 |
1 change: 1 addition & 0 deletions
1
test/integration_new/stash/stash/expected/repo/.git_keep/refs/stash
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 @@ | ||
c86eeda485a49ca608cb2617bb027be66cd92bc3 |
1 change: 1 addition & 0 deletions
1
...egration_new/stash/stash_including_untracked_files/expected/repo/.git_keep/COMMIT_EDITMSG
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 @@ | ||
initial commit |
Empty file.
1 change: 1 addition & 0 deletions
1
test/integration_new/stash/stash_including_untracked_files/expected/repo/.git_keep/HEAD
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 @@ | ||
ref: refs/heads/master |
1 change: 1 addition & 0 deletions
1
test/integration_new/stash/stash_including_untracked_files/expected/repo/.git_keep/ORIG_HEAD
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 @@ | ||
364ac39500dfec09956626a513736d7602b4d64a |
12 changes: 12 additions & 0 deletions
12
test/integration_new/stash/stash_including_untracked_files/expected/repo/.git_keep/config
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,12 @@ | ||
[core] | ||
repositoryformatversion = 0 | ||
filemode = true | ||
bare = false | ||
logallrefupdates = true | ||
ignorecase = true | ||
precomposeunicode = true | ||
[user] | ||
email = [email protected] | ||
name = CI | ||
[commit] | ||
gpgSign = false |
1 change: 1 addition & 0 deletions
1
...integration_new/stash/stash_including_untracked_files/expected/repo/.git_keep/description
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 @@ | ||
Unnamed repository; edit this file 'description' to name the repository. |
Binary file added
BIN
+65 Bytes
test/integration_new/stash/stash_including_untracked_files/expected/repo/.git_keep/index
Binary file not shown.
6 changes: 6 additions & 0 deletions
6
...ntegration_new/stash/stash_including_untracked_files/expected/repo/.git_keep/info/exclude
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,6 @@ | ||
# 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] | ||
# *~ |
2 changes: 2 additions & 0 deletions
2
test/integration_new/stash/stash_including_untracked_files/expected/repo/.git_keep/logs/HEAD
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,2 @@ | ||
0000000000000000000000000000000000000000 364ac39500dfec09956626a513736d7602b4d64a CI <[email protected]> 1668288767 -0330 commit (initial): initial commit | ||
364ac39500dfec09956626a513736d7602b4d64a 364ac39500dfec09956626a513736d7602b4d64a CI <[email protected]> 1668288768 -0330 reset: moving to HEAD |
1 change: 1 addition & 0 deletions
1
..._new/stash/stash_including_untracked_files/expected/repo/.git_keep/logs/refs/heads/master
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 @@ | ||
0000000000000000000000000000000000000000 364ac39500dfec09956626a513736d7602b4d64a CI <[email protected]> 1668288767 -0330 commit (initial): initial commit |
1 change: 1 addition & 0 deletions
1
...gration_new/stash/stash_including_untracked_files/expected/repo/.git_keep/logs/refs/stash
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 @@ | ||
0000000000000000000000000000000000000000 03892119fb6b807d1c13c23f6baacdc4a170e694 CI <[email protected]> 1668288768 -0330 On master: my stashed file |
1 change: 1 addition & 0 deletions
1
...untracked_files/expected/repo/.git_keep/objects/03/892119fb6b807d1c13c23f6baacdc4a170e694
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 @@ | ||
x��=jA���{��@��_2!\��F# <^��@r�L�>���__Ǹ�.��U'�����%KK>W&�����F˽=�6ÒZ��ĴQ.%��}��H-8�4O��S�$uK ���4C&4�5TC~z0�l�YEI�Q4��kK\s0��Ҿ���pǓ{?�>����U��:>�/b-�^!FX�:O��O�|��h��7~ݶ�����r�?��]. |
Binary file added
BIN
+147 Bytes
...untracked_files/expected/repo/.git_keep/objects/0f/e7bff1bede9ebb8de52517a4b75ad0f80be423
Binary file not shown.
Binary file added
BIN
+51 Bytes
...untracked_files/expected/repo/.git_keep/objects/18/77c1658e50742642146b3bbb24c6b8635c7b64
Binary file not shown.
Binary file added
BIN
+123 Bytes
...untracked_files/expected/repo/.git_keep/objects/36/4ac39500dfec09956626a513736d7602b4d64a
Binary file not shown.
Binary file added
BIN
+15 Bytes
...untracked_files/expected/repo/.git_keep/objects/4b/825dc642cb6eb9a060e54bf8d69288fbee4904
Binary file not shown.
Binary file added
BIN
+22 Bytes
...untracked_files/expected/repo/.git_keep/objects/6b/584e8ece562ebffc15d38808cd6b98fc3d97ea
Binary file not shown.
Binary file added
BIN
+167 Bytes
...untracked_files/expected/repo/.git_keep/objects/8d/147cc9d3f9cf40d1723b9099b98ffdb3727f8b
Binary file not shown.
Binary file added
BIN
+51 Bytes
...untracked_files/expected/repo/.git_keep/objects/dd/e611c48bd5d6df4157b99f524929851b07eca9
Binary file not shown.
1 change: 1 addition & 0 deletions
1
...ation_new/stash/stash_including_untracked_files/expected/repo/.git_keep/refs/heads/master
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 @@ | ||
364ac39500dfec09956626a513736d7602b4d64a |
1 change: 1 addition & 0 deletions
1
.../integration_new/stash/stash_including_untracked_files/expected/repo/.git_keep/refs/stash
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 @@ | ||
03892119fb6b807d1c13c23f6baacdc4a170e694 |