Closed ysalmon closed 7 months ago
I think the culprit is around here https://github.com/Murmele/Gittyup/blame/ec9980f6991795545bec149bd773ae2206133b51/src/git/Repository.cpp#L155 : I do not really understand why there are assert
here ; it is not an error for a gitdir to be not be named .git
, however if that is not the case, we do not want to remove the last part of the path (if that is what dir.cdUp()
does).
My previous issue #612 was about repos not being properly managed when the work tree is out of the git dir.
I submitted a PR #614 to address this, which was merged, albeit with some modifications, eg. https://github.com/Murmele/Gittyup/pull/614/commits/0fd2d5506aee802291acf139bffb434cac8df775, which changes the logic I proposed to determine the name of a repo to avoid infinite loops (which I did not experience, but I admit I did not test extensively).
However, this seems to lead to a resurgence of the initial problem.
With the situation of #612, namely
opening
a
in Gittyup gives a title oftmp
(in #612 that wasb
). It actually gets registered as/tmp
inGittyup.conf
.Moreover, in my actual use case of a git repo in
$HOME/Documents/Enseignement/publication-tex.git/
having a config set toworktree = $HOME/Documents/Enseignement/somewhere/Chato-Info/etc/chato
, I stumble back on the unwanted behaviour that opening that repo (from its git repo dir) works but lists the repo asEnseignement
and writes an inconsistent state inGittyup.conf
, withlastpath
being, correctly,$HOME/Documents/Enseignement/publication-tex.git
, but the repo appearing as$HOME/Documents/Enseignement
in the recent list. Therefore, the repo also gets listed asEnseignement
in the recent list of the GUI, and trying to open the repo from that list leads to an error.