1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-06-15 00:15:32 +02:00
Commit Graph

54 Commits

Author SHA1 Message Date
da24deb881 Allow changing diff context size and rename threshold when main view is focused 2025-04-23 08:38:46 +02:00
362678e2ef Mention which command is continued in PromptToContinueRebase
When you are in the middle of a rebase, and you cherry-pick a commit which
conflicts, it helps to be clear on whether you are prompted to continue the
cherry-pick or the rebase.
2025-04-20 15:53:17 +02:00
b0ab6529c1 Escape special characters when git-ignoring files 2025-04-13 18:25:24 +10:00
41f89d86f0 Add test that shows problems with git-ignoring files with special characters
For #, !, [, and ], the problem is that it doesn't ignore the file because the
special characters need to be quoted. For *, the problem is that it ignores too
much (it also hides the abc_def file because the * is treated as a glob).
2025-04-13 18:25:24 +10:00
b0b8ef9cf6 Fix display of renamed files
This broke with #4346 (Add root node in file tree).
2025-04-02 18:15:44 +02:00
267ef70de6 Add test showing problem with the display of renamed files
Renaming a file inside the same directory shows it with its full path in the
tree view, which isn't what we want. We'll fix this in the next commit.

Also adding a few other test cases for moving files; they show that the display
of moved files in tree view isn't ideal. For example, moving file1 from top
level into dir shows it as "R file1 → file1", which isn't distinguishable from
renaming file1 inside dir. I suppose what we would like to have here is
"R ../file1 → file1" or something, but I'll leave that for the future; here I
only want to fix the regression that was introduced with the root item PR.
2025-04-02 18:15:27 +02:00
a8f6b04ff3 Add "Absolute path" item to the file view's copy menu
Rename the existing item to "Relative path".
2025-03-25 10:00:56 +01:00
26459523f5 Add a root item ("/") if files at top level have changed 2025-03-21 08:04:58 +01:00
0b5504aa98 Cleanup: make integration test assertions for files panel more specific
Assert the entire lines using Equals instead of Contains. This makes the tests a
bit easier to read, and it makes it much easier to decide how they need to be
changed when we change the layout (like we do in the last commit of this
branch).

It is true that this requires changing all these tests for any future UI
changes, but I think this is a good price to pay; those adaptions are trivial
and can be done without thinking.
2025-03-20 11:58:50 +01:00
caca62b89e Cleanup: simplify and tighten test expectations related to clipboard
Change our fake clipboard command to not append a linefeed; that's closer to
what the production code does.

This allows us to use Equals instead of Contains for checking the clipboard
contents.

Finally, use FileSystem().FileContent() to assert the clipboard contents,
instead of selecting the clipboard file and then checking the diff view.
2025-02-19 18:50:12 +01:00
7bea41534b Collapse/expand all files in tree
Co-authored-by: Stefan Haller <stefan@haller-berlin.de>
2025-01-13 21:13:11 +01:00
ba21d4e651 Ask to auto-stage unstaged files when continuing a rebase after resolving conflicts 2024-09-02 18:24:36 +02:00
387bdb1b84 Don't stage already staged deleted items 2024-08-24 09:36:44 +10:00
55d8e801f1 Use getters for AppState and UserConfig instead of accessing the fields directly
This will allow us to make them private.
2024-08-18 10:24:52 +02:00
b9107d5fc8 Support setting the similarity threshold for detecting renames 2024-07-13 14:24:26 +10:00
38aa5b89ab Simplify integration test 2024-07-06 21:22:04 +10:00
2e5b570bb6 Add integration test 2024-07-06 21:22:04 +10:00
269ef7f250 Support range select for staging/discarding files
As part of this, you must now press enter on a merge conflict file
to focus the merge view; you can no longer press space and if you do
it will raise an error.
2024-01-25 11:34:59 +11:00
51fb82d6bf Enforce single-item selection in various actions
We want to show an error when the user tries to invoke an action that expects only
a single item to be selected.

We're using the GetDisabledReason field to enforce this (as well as DisabledReason
on menu items).

I've created a ListControllerTrait to store some shared convenience functions for this.
2024-01-19 10:50:49 +11:00
09a24ee97d Use ErrorToast instead of error panel when invoking a disabled command 2024-01-14 17:45:35 +01:00
8ca8a43968 Make it mandatory to acknowledge toasts in tests 2024-01-14 17:42:03 +01:00
c7012528fc feat: introduce a copy menu into the file view 2023-12-07 08:30:03 +01:00
16ed3c2377 Retry on index.lock error
I don't know why we're getting index.lock errors but they're impossile to stop
anyway given that other processes can be calling git commands. So we're retrying
a few times before re-raising. To do this we need to clone the command and the current
implementation for that is best-effort.

I do worry about the maintainability of that but we'll see how it goes.

Also, I thought you'd need to clone the task (if it exists) but now I think not;
as long as you don't call done twice on it you should be fine, and you shouldn't
be done'ing a task as part of running a command: that should happen higher up.
2023-07-10 19:13:18 +10:00
fdee0e1497 Fix test
It's still skipped but it had an error
2023-07-09 20:57:18 +10:00
fd861826bc Add integration tests for discarding files 2023-07-03 12:54:13 +10:00
d772c9f1d4 Use sentence case everywhere
We have not been good at consistent casing so far. Now we use 'Sentence case' everywhere. EVERYWHERE.

Also Removing 'Lc' prefix from i18n field names: the 'Lc' stood for lowercase but now that everything
is in 'Sentence case' there's no need for the distinction.

I've got a couple lower case things I've kept: namely, things that show up in parentheses.
2023-05-25 23:52:19 +10:00
fb0931e1a1 Fix discard logic
Missed a spot a couple PR's ago. We had an integration test which caught this but which was skipped due
to index.lock file issues. The test was also broken for other reasons due to it not having been running
for a while, so I've fixed that up too.
2023-05-23 20:23:08 +10:00
63dc07fded Construct arg vector manually rather than parse string
By constructing an arg vector manually, we no longer need to quote arguments

Mandate that args must be passed when building a command

Now you need to provide an args array when building a command.
There are a handful of places where we need to deal with a string,
such as with user-defined custom commands, and for those we now require
that at the callsite they use str.ToArgv to do that. I don't want
to provide a method out of the box for it because I want to discourage its
use.

For some reason we were invoking a command through a shell when amending a
commit, and I don't believe we needed to do that as there was nothing user-
supplied about the command. So I've switched to using a regular command out-
side the shell there
2023-05-23 19:49:19 +10:00
45d45d2397 show file tree by default in integration tests 2023-02-26 13:01:51 +11:00
f7e8b2dd71 cleanup integration test code 2023-02-26 12:54:13 +11:00
c63fed2074 migrate staging tests 2023-02-23 22:29:40 +11:00
1034962c7e migrate more tests 2023-02-22 22:29:01 +11:00
f999bbce7c add code generator for creating tests list 2023-02-19 11:48:09 +11:00
8a1c763942 more git ignore stuff in integration test 2022-12-30 22:42:32 +11:00
f770a6246b rename function 2022-12-28 14:19:56 +11:00
5e9a897348 migrate ignore gitignore integration test 2022-12-28 13:35:07 +11:00
f2d0f362d4 migrate discard staged changes test 2022-12-28 13:24:23 +11:00
9fef4447b6 move popup assertions into a struct 2022-12-28 11:00:22 +11:00
ed93e0a2b0 remove dependency on model 2022-12-27 22:52:20 +11:00
c5050ecabd move shell into test driver 2022-12-27 21:47:37 +11:00
78b495f50a rename input to t 2022-12-27 21:35:36 +11:00
b166b8f776 combine assert and input structs, clean up interface 2022-12-27 21:26:18 +11:00
09e80e5f2a better namespacing for assertions 2022-12-27 21:26:18 +11:00
be30cbb375 add view asserter getter struct 2022-12-27 21:26:18 +11:00
926ed7b9b2 more refactoring of popup stuff 2022-12-27 21:26:18 +11:00
8052ac4fd6 add prompt asserter 2022-12-27 21:26:18 +11:00
c976839a63 refactor prompt handling in integration tests 2022-12-27 21:26:17 +11:00
96310288ee allow chaining matchers 2022-12-26 17:15:33 +11:00
9a6f21ce42 cleaner test assertions 2022-12-26 12:20:13 +11:00
fa0414777f rename SelectedLine to CurrentLine in tests 2022-12-26 10:42:19 +11:00