Fix log crashing in subdirectories
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 can you add a teest for that so we don't regress on this again?
@cruessler we also need to make sure it does respect the env vars, see https://github.com/extrawurst/gitui/issues/2298
@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 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 :)
@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. :-)
@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.
Sounds great!