summaryrefslogtreecommitdiff
path: root/file
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-08-22 22:34:02 -0300
committerWerner Almesberger <werner@almesberger.net>2016-08-22 22:34:02 -0300
commit5fc2f7c6f3f2dcc9eb60a5dc34895b3fc2800f63 (patch)
tree20c881e906d98e5f9d84b9ce185520e2f5987120 /file
parent8f257d6b6a8fb0f07bab7bd99f4117a3cd9ada2b (diff)
downloadeeshow-5fc2f7c6f3f2dcc9eb60a5dc34895b3fc2800f63.tar.gz
eeshow-5fc2f7c6f3f2dcc9eb60a5dc34895b3fc2800f63.tar.bz2
eeshow-5fc2f7c6f3f2dcc9eb60a5dc34895b3fc2800f63.zip
eeshow/file/git-file.c (related_only_repo): lookup repo again after grafting
Else, symlinks may confuse us.
Diffstat (limited to 'file')
-rw-r--r--file/git-file.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/file/git-file.c b/file/git-file.c
index 1b11a1b..6c828ef 100644
--- a/file/git-file.c
+++ b/file/git-file.c
@@ -392,6 +392,22 @@ static bool related_only_repo(struct vcs_git *vcs_git)
if (!tmp)
return 0;
+ /*
+ * We now have a new path, but where does it lead ? If it contains a
+ * symlink, we may end up in an entirely different repo, where new
+ * adventures await. Let's find out ...
+ */
+ vcs_git->repo = select_repo(tmp);
+ if (vcs_git->repo) {
+ free((char *) vcs_git->name);
+ vcs_git->name = tmp;
+ if (!strcmp(git_repository_path(vcs_git->related->repo),
+ git_repository_path(vcs_git->repo)))
+ return related_same_repo(vcs_git);
+ else
+ return related_other_repo(vcs_git);
+ }
+
vcs_git->repo = related->repo;
vcs_git->tree = related->tree;