X3"9~l?=^ZSUA HdrN/)ra,sX̃w];()ÁkDQ0(߷n|ߦ=@mc=~x7u}B߃^y?yNFY
\ No newline at end of file
diff --git a/test/integration_new/stash/stash/expected/repo/.git_keep/objects/c8/6eeda485a49ca608cb2617bb027be66cd92bc3 b/test/integration_new/stash/stash/expected/repo/.git_keep/objects/c8/6eeda485a49ca608cb2617bb027be66cd92bc3
new file mode 100644
index 0000000000000000000000000000000000000000..330924b9fac1677da05eecc3fe64cd61b396ea8a
GIT binary patch
literal 191
zcmV;w06_nE0gcZ+P6IIzhGFVG#asY1{u|o}A*58PIKy~mtVD{l(XNr;_H08>`{{X$
zPu4N66FlM5+{{3$QzVyiQ=t&lr(QF*Dw3k2wH$jZ3H$Qk&F&M7OtU8Ou9nU*AGuW_
zvVw@pgxR=P4u8JI#zjIc8jc8~NM%DZ=TWF*LDx0(;1~Xymvw{F8QxCk5BuivxY>)W
t;~gAP@ug5Ec*YQLIo9LEw14vD^A3ae!@t7#fqn9RF@=7;*)In=PlT-fV=4du
literal 0
HcmV?d00001
diff --git a/test/integration_new/stash/stash/expected/repo/.git_keep/objects/e6/ed7d5c2198fa4791de9c66e8000da607eaf9a3 b/test/integration_new/stash/stash/expected/repo/.git_keep/objects/e6/ed7d5c2198fa4791de9c66e8000da607eaf9a3
new file mode 100644
index 0000000000000000000000000000000000000000..e53b1e0685465dbedd3532d1a96f05ac7c570599
GIT binary patch
literal 123
zcmV->0EGW|0ga7Y3c@fD0R7G>_5w(zhrbK6Eel5QL}fnh6SSuVI^i4wNvRMuXeyR!(*C9{-(Nbe9NsqVL%LB
d#k+^AwpOc7`$YIpU6pr{k~a8t>I8(zFWt0#J0t)A
literal 0
HcmV?d00001
diff --git a/test/integration_new/stash/stash/expected/repo/.git_keep/objects/f3/30ace8ec625fc87fe24138f3c4d65e7e8d9b8c b/test/integration_new/stash/stash/expected/repo/.git_keep/objects/f3/30ace8ec625fc87fe24138f3c4d65e7e8d9b8c
deleted file mode 100644
index c63423382db7755e5c4753cc40cbd055cfdf4256..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 168
zcmV;Z09XHb0gaAL3c@fDg)vLZHH-w%QWBk?dxOVQ{3tmBvGdZHySvi(kOb{r5gV^7iCTShHZuF
WpPf4Yte~u=6~DmuP<#Lq^hKmQJx_iB
diff --git a/test/integration_new/stash/stash/expected/repo/.git_keep/refs/heads/master b/test/integration_new/stash/stash/expected/repo/.git_keep/refs/heads/master
index bf1549f7e..9130d91a2 100644
--- a/test/integration_new/stash/stash/expected/repo/.git_keep/refs/heads/master
+++ b/test/integration_new/stash/stash/expected/repo/.git_keep/refs/heads/master
@@ -1 +1 @@
-6227ee90e6cf6047b510f13dc6cc976e2dd372dd
+e6ed7d5c2198fa4791de9c66e8000da607eaf9a3
diff --git a/test/integration_new/stash/stash/expected/repo/.git_keep/refs/stash b/test/integration_new/stash/stash/expected/repo/.git_keep/refs/stash
index c03c37c76..a976f263d 100644
--- a/test/integration_new/stash/stash/expected/repo/.git_keep/refs/stash
+++ b/test/integration_new/stash/stash/expected/repo/.git_keep/refs/stash
@@ -1 +1 @@
-9ca683cf1ae1a37fb25ec24646acc0dc1db376e7
+c86eeda485a49ca608cb2617bb027be66cd92bc3
diff --git a/test/integration_new/stash/stash_including_untracked_files/expected/repo/.git_keep/ORIG_HEAD b/test/integration_new/stash/stash_including_untracked_files/expected/repo/.git_keep/ORIG_HEAD
index 4ee40e25d..8b6d164d8 100644
--- a/test/integration_new/stash/stash_including_untracked_files/expected/repo/.git_keep/ORIG_HEAD
+++ b/test/integration_new/stash/stash_including_untracked_files/expected/repo/.git_keep/ORIG_HEAD
@@ -1 +1 @@
-d25b2c8a3d20c1b1884fbf1c87aa2014dd99ed7f
+364ac39500dfec09956626a513736d7602b4d64a
diff --git a/test/integration_new/stash/stash_including_untracked_files/expected/repo/.git_keep/logs/HEAD b/test/integration_new/stash/stash_including_untracked_files/expected/repo/.git_keep/logs/HEAD
index e8dcfb6d1..1350d45f0 100644
--- a/test/integration_new/stash/stash_including_untracked_files/expected/repo/.git_keep/logs/HEAD
+++ b/test/integration_new/stash/stash_including_untracked_files/expected/repo/.git_keep/logs/HEAD
@@ -1,2 +1,2 @@
-0000000000000000000000000000000000000000 d25b2c8a3d20c1b1884fbf1c87aa2014dd99ed7f CI 1665105632 -0230 commit (initial): initial commit
-d25b2c8a3d20c1b1884fbf1c87aa2014dd99ed7f d25b2c8a3d20c1b1884fbf1c87aa2014dd99ed7f CI 1665105633 -0230 reset: moving to HEAD
+0000000000000000000000000000000000000000 364ac39500dfec09956626a513736d7602b4d64a CI 1668288767 -0330 commit (initial): initial commit
+364ac39500dfec09956626a513736d7602b4d64a 364ac39500dfec09956626a513736d7602b4d64a CI 1668288768 -0330 reset: moving to HEAD
diff --git a/test/integration_new/stash/stash_including_untracked_files/expected/repo/.git_keep/logs/refs/heads/master b/test/integration_new/stash/stash_including_untracked_files/expected/repo/.git_keep/logs/refs/heads/master
index df042a3dd..9653f3a4b 100644
--- a/test/integration_new/stash/stash_including_untracked_files/expected/repo/.git_keep/logs/refs/heads/master
+++ b/test/integration_new/stash/stash_including_untracked_files/expected/repo/.git_keep/logs/refs/heads/master
@@ -1 +1 @@
-0000000000000000000000000000000000000000 d25b2c8a3d20c1b1884fbf1c87aa2014dd99ed7f CI 1665105632 -0230 commit (initial): initial commit
+0000000000000000000000000000000000000000 364ac39500dfec09956626a513736d7602b4d64a CI 1668288767 -0330 commit (initial): initial commit
diff --git a/test/integration_new/stash/stash_including_untracked_files/expected/repo/.git_keep/logs/refs/stash b/test/integration_new/stash/stash_including_untracked_files/expected/repo/.git_keep/logs/refs/stash
index 335d6aab8..9fa56fb7b 100644
--- a/test/integration_new/stash/stash_including_untracked_files/expected/repo/.git_keep/logs/refs/stash
+++ b/test/integration_new/stash/stash_including_untracked_files/expected/repo/.git_keep/logs/refs/stash
@@ -1 +1 @@
-0000000000000000000000000000000000000000 b8eb39e727d4ac91542d57faa0bea0458c2d30e3 CI 1665105633 -0230 On master: stash name
+0000000000000000000000000000000000000000 03892119fb6b807d1c13c23f6baacdc4a170e694 CI 1668288768 -0330 On master: my stashed file
diff --git a/test/integration_new/stash/stash_including_untracked_files/expected/repo/.git_keep/objects/03/892119fb6b807d1c13c23f6baacdc4a170e694 b/test/integration_new/stash/stash_including_untracked_files/expected/repo/.git_keep/objects/03/892119fb6b807d1c13c23f6baacdc4a170e694
new file mode 100644
index 000000000..c933b47b3
--- /dev/null
+++ b/test/integration_new/stash/stash_including_untracked_files/expected/repo/.git_keep/objects/03/892119fb6b807d1c13c23f6baacdc4a170e694
@@ -0,0 +1 @@
+x=jA{@_2!\F# <^@rL>__Ǹ.U'%KK>W&F˽=6ÒZĴQ.%}H-84OS$uK 4C&45TC~z0lYEIQ4kK\s0ҾpǓ{?>U:>/b-^!FX:OO|h7~ݶr?].
\ No newline at end of file
diff --git a/test/integration_new/stash/stash_including_untracked_files/expected/repo/.git_keep/objects/0f/e7bff1bede9ebb8de52517a4b75ad0f80be423 b/test/integration_new/stash/stash_including_untracked_files/expected/repo/.git_keep/objects/0f/e7bff1bede9ebb8de52517a4b75ad0f80be423
new file mode 100644
index 0000000000000000000000000000000000000000..aacb0bb13cbf27bd76012d487ee42ffd64469722
GIT binary patch
literal 147
zcmV;E0Brww0ga7a3c@fDgniB__5w=t)6H5$gg*5c$+}{&X{1fT;~Ve-z74}S-*Cw}
zRnSC-x{9>mJ!|Yq`p!Fp&S;0x#u$xbjD)slAJM6>*JoK_oZvD}H~ED8p5??PUqK_1
zA@WFY?5yonYuibcKXJ7$bq)NIJ3P`X80EGW|0ga783d0}}0DJZo`+*jt>qeoJKu&pvYc^DfwFC=!euaLZ*I|Z9wUpdo
zaQ4y;5kU6Ft%=YiCgBh@X>rJ#Unv;xHx|L5QN>St)&u4R?(;Iq8OwW@TdL&&1Cj6Q
dNF!XewOV!BCr$p;Ret4`;|{-0eF24uFX67lI{*Lx
literal 0
HcmV?d00001
diff --git a/test/integration_new/stash/stash_including_untracked_files/expected/repo/.git_keep/objects/8d/147cc9d3f9cf40d1723b9099b98ffdb3727f8b b/test/integration_new/stash/stash_including_untracked_files/expected/repo/.git_keep/objects/8d/147cc9d3f9cf40d1723b9099b98ffdb3727f8b
new file mode 100644
index 0000000000000000000000000000000000000000..84ee6636f96bcbcd23694592cedfb3f9e7b3740f
GIT binary patch
literal 167
zcmV;Y09gNc0gaAL3c@fDMqTF=a{(p4lSD*>u6m3#GsQsDmKveQw;=A_e!TDT@=|MQ
zpf#S_#tcM^N@W`ca)dNm<@^xi=(LSG2B!w;Ij1PrwDH`)piS9CCnb%XWsD9{V{*!P
zgXB@_!P3Eq^lr~(gRX~L*FShqb)EQAM5lVYQj-7x
literal 0
HcmV?d00001
diff --git a/test/integration_new/stash/stash_including_untracked_files/expected/repo/.git_keep/objects/9d/49589525f6c37d177a53a57d82603a22de6076 b/test/integration_new/stash/stash_including_untracked_files/expected/repo/.git_keep/objects/9d/49589525f6c37d177a53a57d82603a22de6076
deleted file mode 100644
index 99fe3e9e508ead758850bf649230405ae62bedb9..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 170
zcmV;b09F5Z0gaA9YQr!PMZ4B1<^nC6u_Q|&ghEz1#z-@wg2*%%m`r=`i7gC0>s|2a2p5q-kC
YKTncL_5c6?
diff --git a/test/integration_new/stash/stash_including_untracked_files/expected/repo/.git_keep/objects/b8/eb39e727d4ac91542d57faa0bea0458c2d30e3 b/test/integration_new/stash/stash_including_untracked_files/expected/repo/.git_keep/objects/b8/eb39e727d4ac91542d57faa0bea0458c2d30e3
deleted file mode 100644
index eb6b19046..000000000
--- a/test/integration_new/stash/stash_including_untracked_files/expected/repo/.git_keep/objects/b8/eb39e727d4ac91542d57faa0bea0458c2d30e3
+++ /dev/null
@@ -1,2 +0,0 @@
-xMJ1`}\@#"¬f*
-#;Ƿ7wx1nT-"F9R:S(T2cdMr锸R╠aŜC[N"TK1M¹0q'ŔpL Ň)K>Kj*3A°ϼm\a2Ҷ0FF{yz?!_1帹UY`
\ No newline at end of file
diff --git a/test/integration_new/stash/stash_including_untracked_files/expected/repo/.git_keep/objects/d2/5b2c8a3d20c1b1884fbf1c87aa2014dd99ed7f b/test/integration_new/stash/stash_including_untracked_files/expected/repo/.git_keep/objects/d2/5b2c8a3d20c1b1884fbf1c87aa2014dd99ed7f
deleted file mode 100644
index d412fdb6927f1dfd30d03f4a72a0f11807a62c58..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 122
zcmV-=0EPc}0ga7Y3c@fD0R7G>_5#Z0u}cCXLce;9Y`VojW28jz_!hi?zrzeudTVun
zC4U;bDg=p+mcqdmVU?7TQ7On87fvq5Ra8U5VDfuB`VP|!*J-}%C%4z8m(tq}EHhao
c_72YIJeq?Zlc9g=ratSad4pePzI(tguaL(&(f|Me
diff --git a/test/integration_new/stash/stash_including_untracked_files/expected/repo/.git_keep/objects/f8/528a899ebb020e575e007426baa4535207a214 b/test/integration_new/stash/stash_including_untracked_files/expected/repo/.git_keep/objects/f8/528a899ebb020e575e007426baa4535207a214
deleted file mode 100644
index 8cc3c848b..000000000
--- a/test/integration_new/stash/stash_including_untracked_files/expected/repo/.git_keep/objects/f8/528a899ebb020e575e007426baa4535207a214
+++ /dev/null
@@ -1,2 +0,0 @@
-x]
-0})J~7A}16o6|C@pjsޓBIo5Z,&RҖ04|B+ўuqajBtJ:4R)zOcm[PW(q+%M[:
\ No newline at end of file
diff --git a/test/integration_new/stash/stash_including_untracked_files/expected/repo/.git_keep/refs/heads/master b/test/integration_new/stash/stash_including_untracked_files/expected/repo/.git_keep/refs/heads/master
index 4ee40e25d..8b6d164d8 100644
--- a/test/integration_new/stash/stash_including_untracked_files/expected/repo/.git_keep/refs/heads/master
+++ b/test/integration_new/stash/stash_including_untracked_files/expected/repo/.git_keep/refs/heads/master
@@ -1 +1 @@
-d25b2c8a3d20c1b1884fbf1c87aa2014dd99ed7f
+364ac39500dfec09956626a513736d7602b4d64a
diff --git a/test/integration_new/stash/stash_including_untracked_files/expected/repo/.git_keep/refs/stash b/test/integration_new/stash/stash_including_untracked_files/expected/repo/.git_keep/refs/stash
index 3e0f2a550..3512c8618 100644
--- a/test/integration_new/stash/stash_including_untracked_files/expected/repo/.git_keep/refs/stash
+++ b/test/integration_new/stash/stash_including_untracked_files/expected/repo/.git_keep/refs/stash
@@ -1 +1 @@
-b8eb39e727d4ac91542d57faa0bea0458c2d30e3
+03892119fb6b807d1c13c23f6baacdc4a170e694
From af57dbd225c4dae71cd59e0957a8206e4ded5fe7 Mon Sep 17 00:00:00 2001
From: Jesse Duffield
Date: Wed, 9 Nov 2022 19:54:11 +1100
Subject: [PATCH 16/29] Update README.md
---
README.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index 44fc5c640..1b47f65b3 100644
--- a/README.md
+++ b/README.md
@@ -301,9 +301,9 @@ See the [docs](docs/Custom_Command_Keybindings.md)
## Contributing
We love your input! Please check out the [contributing guide](CONTRIBUTING.md).
-For contributor discussion about things not better discussed here in the repo, join the slack channel
+For contributor discussion about things not better discussed here in the repo, join the discord channel
-[](https://join.slack.com/t/lazygit/shared_invite/zt-5bo2clzo-hB8ZTVN5dWUCqj5QFiQVLA)
+[](https://discord.gg/ehwFt2t4wt)
Check out this [video](https://www.youtube.com/watch?v=kNavnhzZHtk) walking through the creation of a small feature in lazygit if you want an idea of where to get started.
From 33410213f188bd6823c8cd84e3b39e9ef97e0e41 Mon Sep 17 00:00:00 2001
From: README-bot
Date: Wed, 9 Nov 2022 08:54:28 +0000
Subject: [PATCH 17/29] Updated README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 1b47f65b3..e7071dc5f 100644
--- a/README.md
+++ b/README.md
@@ -22,7 +22,7 @@ A simple terminal UI for git commands, written in Go with the [gocui](https://gi
-



























































+























































## Elevator Pitch
From c769e5828ca5fd847da15d7b4aeeb161f1fc169e Mon Sep 17 00:00:00 2001
From: Jesse Duffield
Date: Wed, 9 Nov 2022 19:57:26 +1100
Subject: [PATCH 18/29] Update README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index e7071dc5f..77afcd72b 100644
--- a/README.md
+++ b/README.md
@@ -303,7 +303,7 @@ See the [docs](docs/Custom_Command_Keybindings.md)
We love your input! Please check out the [contributing guide](CONTRIBUTING.md).
For contributor discussion about things not better discussed here in the repo, join the discord channel
-[](https://discord.gg/ehwFt2t4wt)
+
Check out this [video](https://www.youtube.com/watch?v=kNavnhzZHtk) walking through the creation of a small feature in lazygit if you want an idea of where to get started.
From ea0968677048b3236e3797e947e4d458096750ed Mon Sep 17 00:00:00 2001
From: Jesse Duffield
Date: Wed, 9 Nov 2022 21:14:14 +1100
Subject: [PATCH 19/29] Update README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 77afcd72b..dba27162e 100644
--- a/README.md
+++ b/README.md
@@ -303,7 +303,7 @@ See the [docs](docs/Custom_Command_Keybindings.md)
We love your input! Please check out the [contributing guide](CONTRIBUTING.md).
For contributor discussion about things not better discussed here in the repo, join the discord channel
-
+
Check out this [video](https://www.youtube.com/watch?v=kNavnhzZHtk) walking through the creation of a small feature in lazygit if you want an idea of where to get started.
From 97ced9e14fe1754c5647c8c693e70fbf7c52807a Mon Sep 17 00:00:00 2001
From: Jesse Duffield
Date: Fri, 11 Nov 2022 12:16:38 +1100
Subject: [PATCH 20/29] fix could-not-access error
---
pkg/commands/git_commands/working_tree.go | 2 +-
pkg/commands/models/file.go | 5 +++
pkg/gui/filetree/file_node.go | 4 +++
pkg/integration/components/shell.go | 9 +++++
.../tests/file/dir_with_untracked_file.go | 32 ++++++++++++++++++
pkg/integration/tests/tests.go | 2 ++
.../expected/repo/.git_keep/COMMIT_EDITMSG | 1 +
.../expected/repo/.git_keep/FETCH_HEAD | 0
.../expected/repo/.git_keep/HEAD | 1 +
.../expected/repo/.git_keep/config | 12 +++++++
.../expected/repo/.git_keep/description | 1 +
.../expected/repo/.git_keep/index | Bin 0 -> 165 bytes
.../expected/repo/.git_keep/info/exclude | 7 ++++
.../expected/repo/.git_keep/logs/HEAD | 1 +
.../repo/.git_keep/logs/refs/heads/master | 1 +
.../19/102815663d23f8b75a47e7a01965dcdc96468c | Bin 0 -> 18 bytes
.../76/3788c33660f53eecaecce8dae27c34e647ac57 | Bin 0 -> 121 bytes
.../87/a5800c820f9b267ff243860bceb24b04af76a2 | Bin 0 -> 49 bytes
.../a9/63b9597d0f4f0b9995472e5eff3622b136a4b5 | Bin 0 -> 45 bytes
.../expected/repo/.git_keep/refs/heads/master | 1 +
.../expected/repo/dir/file | 1 +
.../expected/repo/dir/untracked | 1 +
22 files changed, 80 insertions(+), 1 deletion(-)
create mode 100644 pkg/integration/tests/file/dir_with_untracked_file.go
create mode 100644 test/integration_new/file/dir_with_untracked_file/expected/repo/.git_keep/COMMIT_EDITMSG
create mode 100644 test/integration_new/file/dir_with_untracked_file/expected/repo/.git_keep/FETCH_HEAD
create mode 100644 test/integration_new/file/dir_with_untracked_file/expected/repo/.git_keep/HEAD
create mode 100644 test/integration_new/file/dir_with_untracked_file/expected/repo/.git_keep/config
create mode 100644 test/integration_new/file/dir_with_untracked_file/expected/repo/.git_keep/description
create mode 100644 test/integration_new/file/dir_with_untracked_file/expected/repo/.git_keep/index
create mode 100644 test/integration_new/file/dir_with_untracked_file/expected/repo/.git_keep/info/exclude
create mode 100644 test/integration_new/file/dir_with_untracked_file/expected/repo/.git_keep/logs/HEAD
create mode 100644 test/integration_new/file/dir_with_untracked_file/expected/repo/.git_keep/logs/refs/heads/master
create mode 100644 test/integration_new/file/dir_with_untracked_file/expected/repo/.git_keep/objects/19/102815663d23f8b75a47e7a01965dcdc96468c
create mode 100644 test/integration_new/file/dir_with_untracked_file/expected/repo/.git_keep/objects/76/3788c33660f53eecaecce8dae27c34e647ac57
create mode 100644 test/integration_new/file/dir_with_untracked_file/expected/repo/.git_keep/objects/87/a5800c820f9b267ff243860bceb24b04af76a2
create mode 100644 test/integration_new/file/dir_with_untracked_file/expected/repo/.git_keep/objects/a9/63b9597d0f4f0b9995472e5eff3622b136a4b5
create mode 100644 test/integration_new/file/dir_with_untracked_file/expected/repo/.git_keep/refs/heads/master
create mode 100644 test/integration_new/file/dir_with_untracked_file/expected/repo/dir/file
create mode 100644 test/integration_new/file/dir_with_untracked_file/expected/repo/dir/untracked
diff --git a/pkg/commands/git_commands/working_tree.go b/pkg/commands/git_commands/working_tree.go
index 8fd1fb177..9c02d4300 100644
--- a/pkg/commands/git_commands/working_tree.go
+++ b/pkg/commands/git_commands/working_tree.go
@@ -241,7 +241,7 @@ func (self *WorkingTreeCommands) WorktreeFileDiffCmdObj(node models.IFile, plain
if cached {
cachedArg = " --cached"
}
- if !node.GetIsTracked() && !node.GetHasStagedChanges() && !cached {
+ if !node.GetIsTracked() && !node.GetHasStagedChanges() && !cached && node.GetIsFile() {
trackedArg = "--no-index -- /dev/null"
}
if plain {
diff --git a/pkg/commands/models/file.go b/pkg/commands/models/file.go
index eeb540def..dbe015cf1 100644
--- a/pkg/commands/models/file.go
+++ b/pkg/commands/models/file.go
@@ -29,6 +29,7 @@ type IFile interface {
GetIsTracked() bool
GetPath() string
GetPreviousPath() string
+ GetIsFile() bool
}
func (f *File) IsRename() bool {
@@ -92,6 +93,10 @@ func (f *File) GetPreviousPath() string {
return f.PreviousName
}
+func (f *File) GetIsFile() bool {
+ return true
+}
+
type StatusFields struct {
HasStagedChanges bool
HasUnstagedChanges bool
diff --git a/pkg/gui/filetree/file_node.go b/pkg/gui/filetree/file_node.go
index 2ff707113..abfdbafe6 100644
--- a/pkg/gui/filetree/file_node.go
+++ b/pkg/gui/filetree/file_node.go
@@ -42,6 +42,10 @@ func (self *FileNode) GetIsTracked() bool {
return self.SomeFile(func(file *models.File) bool { return file.Tracked })
}
+func (self *FileNode) GetIsFile() bool {
+ return self.IsFile()
+}
+
func (self *FileNode) GetPreviousPath() string {
if self.File == nil {
return ""
diff --git a/pkg/integration/components/shell.go b/pkg/integration/components/shell.go
index 1d8182edb..95b601783 100644
--- a/pkg/integration/components/shell.go
+++ b/pkg/integration/components/shell.go
@@ -45,6 +45,15 @@ func (s *Shell) CreateFile(path string, content string) *Shell {
return s
}
+func (s *Shell) CreateDir(path string) *Shell {
+ fullPath := filepath.Join(s.dir, path)
+ if err := os.MkdirAll(fullPath, 0o755); err != nil {
+ panic(fmt.Sprintf("error creating directory: %s\n%s", fullPath, err))
+ }
+
+ return s
+}
+
func (s *Shell) UpdateFile(path string, content string) *Shell {
fullPath := filepath.Join(s.dir, path)
err := os.WriteFile(fullPath, []byte(content), 0o644)
diff --git a/pkg/integration/tests/file/dir_with_untracked_file.go b/pkg/integration/tests/file/dir_with_untracked_file.go
new file mode 100644
index 000000000..c67745c65
--- /dev/null
+++ b/pkg/integration/tests/file/dir_with_untracked_file.go
@@ -0,0 +1,32 @@
+package file
+
+import (
+ "github.com/jesseduffield/lazygit/pkg/config"
+ . "github.com/jesseduffield/lazygit/pkg/integration/components"
+)
+
+var DirWithUntrackedFile = NewIntegrationTest(NewIntegrationTestArgs{
+ // notably, we currently _don't_ actually see the untracked file in the diff. Not sure how to get around that.
+ Description: "When selecting a directory that contains an untracked file, we should not get an error",
+ ExtraCmdArgs: "",
+ Skip: false,
+ SetupConfig: func(config *config.AppConfig) {
+ config.UserConfig.Gui.ShowFileTree = true
+ },
+ SetupRepo: func(shell *Shell) {
+ shell.CreateDir("dir")
+ shell.CreateFile("dir/file", "foo")
+ shell.GitAddAll()
+ shell.Commit("first commit")
+ shell.CreateFile("dir/untracked", "bar")
+ shell.UpdateFile("dir/file", "baz")
+ },
+ Run: func(shell *Shell, input *Input, assert *Assert, keys config.KeybindingConfig) {
+ assert.CommitCount(1)
+
+ assert.MatchMainViewContent(NotContains("error: Could not access"))
+ // we show baz because it's a modified file but we don't show bar because it's untracked
+ // (though it would be cool if we could show that too)
+ assert.MatchMainViewContent(Contains("baz"))
+ },
+})
diff --git a/pkg/integration/tests/tests.go b/pkg/integration/tests/tests.go
index e26836b59..0765c8600 100644
--- a/pkg/integration/tests/tests.go
+++ b/pkg/integration/tests/tests.go
@@ -15,6 +15,7 @@ import (
"github.com/jesseduffield/lazygit/pkg/integration/tests/cherry_pick"
"github.com/jesseduffield/lazygit/pkg/integration/tests/commit"
"github.com/jesseduffield/lazygit/pkg/integration/tests/custom_commands"
+ "github.com/jesseduffield/lazygit/pkg/integration/tests/file"
"github.com/jesseduffield/lazygit/pkg/integration/tests/interactive_rebase"
"github.com/jesseduffield/lazygit/pkg/integration/tests/stash"
"github.com/jesseduffield/lazygit/pkg/utils"
@@ -43,6 +44,7 @@ var tests = []*components.IntegrationTest{
stash.Stash,
stash.StashIncludingUntrackedFiles,
stash.Rename,
+ file.DirWithUntrackedFile,
}
func GetTests() []*components.IntegrationTest {
diff --git a/test/integration_new/file/dir_with_untracked_file/expected/repo/.git_keep/COMMIT_EDITMSG b/test/integration_new/file/dir_with_untracked_file/expected/repo/.git_keep/COMMIT_EDITMSG
new file mode 100644
index 000000000..5ec586d22
--- /dev/null
+++ b/test/integration_new/file/dir_with_untracked_file/expected/repo/.git_keep/COMMIT_EDITMSG
@@ -0,0 +1 @@
+first commit
diff --git a/test/integration_new/file/dir_with_untracked_file/expected/repo/.git_keep/FETCH_HEAD b/test/integration_new/file/dir_with_untracked_file/expected/repo/.git_keep/FETCH_HEAD
new file mode 100644
index 000000000..e69de29bb
diff --git a/test/integration_new/file/dir_with_untracked_file/expected/repo/.git_keep/HEAD b/test/integration_new/file/dir_with_untracked_file/expected/repo/.git_keep/HEAD
new file mode 100644
index 000000000..cb089cd89
--- /dev/null
+++ b/test/integration_new/file/dir_with_untracked_file/expected/repo/.git_keep/HEAD
@@ -0,0 +1 @@
+ref: refs/heads/master
diff --git a/test/integration_new/file/dir_with_untracked_file/expected/repo/.git_keep/config b/test/integration_new/file/dir_with_untracked_file/expected/repo/.git_keep/config
new file mode 100644
index 000000000..8a748ce32
--- /dev/null
+++ b/test/integration_new/file/dir_with_untracked_file/expected/repo/.git_keep/config
@@ -0,0 +1,12 @@
+[core]
+ repositoryformatversion = 0
+ filemode = true
+ bare = false
+ logallrefupdates = true
+ ignorecase = true
+ precomposeunicode = true
+[user]
+ email = CI@example.com
+ name = CI
+[commit]
+ gpgSign = false
diff --git a/test/integration_new/file/dir_with_untracked_file/expected/repo/.git_keep/description b/test/integration_new/file/dir_with_untracked_file/expected/repo/.git_keep/description
new file mode 100644
index 000000000..498b267a8
--- /dev/null
+++ b/test/integration_new/file/dir_with_untracked_file/expected/repo/.git_keep/description
@@ -0,0 +1 @@
+Unnamed repository; edit this file 'description' to name the repository.
diff --git a/test/integration_new/file/dir_with_untracked_file/expected/repo/.git_keep/index b/test/integration_new/file/dir_with_untracked_file/expected/repo/.git_keep/index
new file mode 100644
index 0000000000000000000000000000000000000000..486f8bab9e2e329dca9349f939a0fd2479a4510e
GIT binary patch
literal 165
zcmZ?q402{*U|<4b#^l^3rxfl#_lMDp3=FJnpGw>q7#f!VrN08zhyXEzq=1HKnyvDW
z?NRQ}7f7bwxiihJhk+v{vq(QJGbfdSAtcDv6{yUV!BD}FYi07z$Xb4X?wM2F_2T}U
zDQz@cvK6QlC}+UczO;d-iGQ|Q{U_%(?sJ>GS=N^=GR 1668129994 +1100 commit (initial): first commit
diff --git a/test/integration_new/file/dir_with_untracked_file/expected/repo/.git_keep/logs/refs/heads/master b/test/integration_new/file/dir_with_untracked_file/expected/repo/.git_keep/logs/refs/heads/master
new file mode 100644
index 000000000..5a93ac9cc
--- /dev/null
+++ b/test/integration_new/file/dir_with_untracked_file/expected/repo/.git_keep/logs/refs/heads/master
@@ -0,0 +1 @@
+0000000000000000000000000000000000000000 763788c33660f53eecaecce8dae27c34e647ac57 CI 1668129994 +1100 commit (initial): first commit
diff --git a/test/integration_new/file/dir_with_untracked_file/expected/repo/.git_keep/objects/19/102815663d23f8b75a47e7a01965dcdc96468c b/test/integration_new/file/dir_with_untracked_file/expected/repo/.git_keep/objects/19/102815663d23f8b75a47e7a01965dcdc96468c
new file mode 100644
index 0000000000000000000000000000000000000000..280a426b7656bd61cdd4f48a43f8088ea18291b6
GIT binary patch
literal 18
Zcmbd;@;K>oCKtt=3He
z2@l#uAaV4WiKn|Qq1epK6ecGmrTFMvMjuniWYSw7t;4*)WnOObNp*k9X>Iii7~>h;
bC<7c3tu=#=iOQe4DO-Oj{3`PW+ubgI%49d`
literal 0
HcmV?d00001
diff --git a/test/integration_new/file/dir_with_untracked_file/expected/repo/.git_keep/objects/87/a5800c820f9b267ff243860bceb24b04af76a2 b/test/integration_new/file/dir_with_untracked_file/expected/repo/.git_keep/objects/87/a5800c820f9b267ff243860bceb24b04af76a2
new file mode 100644
index 0000000000000000000000000000000000000000..115dcca4644a2968b0626173be1b391ff6e94da9
GIT binary patch
literal 49
zcmV-10M7q-0V^p=O;s>9VlXr?Ff%bxNXyJgWsnrm5KXgH{;@sE{rLjP)H`>kx%B`5
H>1++gxn&gE
literal 0
HcmV?d00001
diff --git a/test/integration_new/file/dir_with_untracked_file/expected/repo/.git_keep/objects/a9/63b9597d0f4f0b9995472e5eff3622b136a4b5 b/test/integration_new/file/dir_with_untracked_file/expected/repo/.git_keep/objects/a9/63b9597d0f4f0b9995472e5eff3622b136a4b5
new file mode 100644
index 0000000000000000000000000000000000000000..ba6b1afcde1396992dcafef1d18d328bec541c01
GIT binary patch
literal 45
zcmV+|0Mh?>0V^p=O;s>9U@$QN0)>>!B8K**4LnW!v(@T9Ik$12+vLr%zHAWy
Date: Sat, 12 Nov 2022 10:18:02 +1100
Subject: [PATCH 21/29] fix broken CI (see
https://vielmetti.typepad.com/logbook/2022/10/git-security-fixes-lead-to-fatal-transport-file-not-allowed-error-in-ci-systems-cve-2022-39253.html)
try this
WIP
---
.github/workflows/ci.yml | 3 ++-
pkg/integration/components/runner.go | 1 +
test/integration/submoduleAdd/setup.sh | 5 +++++
test/integration/submoduleEnter/setup.sh | 2 +-
test/integration/submoduleRemove/setup.sh | 2 +-
test/integration/submoduleReset/setup.sh | 2 +-
6 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index a781b290f..d09b8a53a 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -73,8 +73,9 @@ jobs:
restore-keys: |
${{runner.os}}-go-
- name: Test code
+ # for file.allow thing see https://vielmetti.typepad.com/logbook/2022/10/git-security-fixes-lead-to-fatal-transport-file-not-allowed-error-in-ci-systems-cve-2022-39253.html
run: |
- PARALLEL_TOTAL=${{ matrix.parallelism }} PARALLEL_INDEX=${{ matrix.index }} go test pkg/integration/deprecated/*.go
+ git config --global protocol.file.allow always && PARALLEL_TOTAL=${{ matrix.parallelism }} PARALLEL_INDEX=${{ matrix.index }} go test pkg/integration/deprecated/*.go
integration-tests:
runs-on: ubuntu-latest
name: "Integration Tests"
diff --git a/pkg/integration/components/runner.go b/pkg/integration/components/runner.go
index d25f3795c..11b34db11 100644
--- a/pkg/integration/components/runner.go
+++ b/pkg/integration/components/runner.go
@@ -144,6 +144,7 @@ func createFixture(test *IntegrationTest, paths Paths) error {
shell.RunCommand(`git config user.email "CI@example.com"`)
shell.RunCommand(`git config user.name "CI"`)
shell.RunCommand(`git config commit.gpgSign false`)
+ shell.RunCommand(`git config protocol.file.allow always`)
test.SetupRepo(shell)
diff --git a/test/integration/submoduleAdd/setup.sh b/test/integration/submoduleAdd/setup.sh
index 47c92bd27..35a139f79 100644
--- a/test/integration/submoduleAdd/setup.sh
+++ b/test/integration/submoduleAdd/setup.sh
@@ -11,6 +11,11 @@ git init
git config user.email "CI@example.com"
git config user.name "CI"
+# see https://vielmetti.typepad.com/logbook/2022/10/git-security-fixes-lead-to-fatal-transport-file-not-allowed-error-in-ci-systems-cve-2022-39253.html
+# NOTE: I don't think this actually works if it's only applied to the repo.
+# On CI we set the global setting, but given it's a security concern I don't want
+# people to do that for their locals.
+git config protocol.file.allow always
echo test1 > myfile1
git add .
diff --git a/test/integration/submoduleEnter/setup.sh b/test/integration/submoduleEnter/setup.sh
index 307593a71..a38c6045b 100644
--- a/test/integration/submoduleEnter/setup.sh
+++ b/test/integration/submoduleEnter/setup.sh
@@ -26,5 +26,5 @@ cd ..
git clone --bare ./repo other_repo
cd repo
-git submodule add ../other_repo
+git -c protocol.file.allow=always submodule add ../other_repo
git commit -am "add submodule"
diff --git a/test/integration/submoduleRemove/setup.sh b/test/integration/submoduleRemove/setup.sh
index 2525abf31..cd5b3ce64 100644
--- a/test/integration/submoduleRemove/setup.sh
+++ b/test/integration/submoduleRemove/setup.sh
@@ -23,5 +23,5 @@ cd ..
git clone --bare ./repo other_repo
cd repo
-git submodule add ../other_repo
+git -c protocol.file.allow=always submodule add ../other_repo
git commit -am "add submodule"
diff --git a/test/integration/submoduleReset/setup.sh b/test/integration/submoduleReset/setup.sh
index 2525abf31..cd5b3ce64 100644
--- a/test/integration/submoduleReset/setup.sh
+++ b/test/integration/submoduleReset/setup.sh
@@ -23,5 +23,5 @@ cd ..
git clone --bare ./repo other_repo
cd repo
-git submodule add ../other_repo
+git -c protocol.file.allow=always submodule add ../other_repo
git commit -am "add submodule"
From fd581ef70c22f881837eecdf02a16fcdfa039b61 Mon Sep 17 00:00:00 2001
From: README-bot
Date: Fri, 11 Nov 2022 23:58:16 +0000
Subject: [PATCH 22/29] Updated README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index dba27162e..a9fbba53d 100644
--- a/README.md
+++ b/README.md
@@ -22,7 +22,7 @@ A simple terminal UI for git commands, written in Go with the [gocui](https://gi