gitui icon indicating copy to clipboard operation
gitui copied to clipboard

Fix log crashing in subdirectories

Open cruessler opened this issue 1 year ago • 3 comments

When opened in a sub-directory of a git repository, the log view crashes. Replacing gix::open by gix::discover fixes this issue. gix::open errors when the passed directory is not a git repository, gix::discover searches parent directories for a git repository. The code causing the crash has not been released yet, so no changelog entry is necessary.

cruessler avatar Jul 23 '24 13:07 cruessler

@cruessler can you add a teest for that so we don't regress on this again?

extrawurst avatar Jul 25 '24 03:07 extrawurst

@cruessler we also need to make sure it does respect the env vars, see https://github.com/extrawurst/gitui/issues/2298

extrawurst avatar Jul 25 '24 04:07 extrawurst

@cruessler can you add a teest for that so we don't regress on this again?

@extrawurst I just added a test for running AsyncLog in a sub-directory (the test fails on master, but passes on this branch). The test works, but it feels a bit like testing implementation details. I think we could keep it for now, but might want to come up with a cleaner test in the future. What do you think?

I’ll have a look at environment variables next.

cruessler avatar Aug 05 '24 12:08 cruessler

@cruessler please make a followup with a test for the env, this broke in the past and it would be good to know when it does :)

extrawurst avatar Sep 17 '24 09:09 extrawurst

@cruessler please make a followup with a test for the env, this broke in the past and it would be good to know when it does :)

Will do, I put it on my todo list. :-)

cruessler avatar Sep 17 '24 09:09 cruessler

@extrawurst I would really like to write an integration test for env variables, similar to what I’ve tried in #2368. That way, we ideally would have a test that read like “set env variable, start app, expect screenshot showing the loaded app to look like snapshot”. I will also try adding a test to app.rs.

cruessler avatar Oct 09 '24 14:10 cruessler

Sounds great!

extrawurst avatar Oct 09 '24 22:10 extrawurst