From 97279b04dc37bbc9b132a88cfc8b9302ba95ed79 Mon Sep 17 00:00:00 2001 From: eidheim Date: Mon, 29 Oct 2018 08:40:16 +0100 Subject: [PATCH] Fixed directory git status for paths within a symbolic linked folder --- src/directories.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/directories.cc b/src/directories.cc index 7bd0979..b5b9c9a 100644 --- a/src/directories.cc +++ b/src/directories.cc @@ -693,10 +693,16 @@ void Directories::colorize_path(boost::filesystem::path dir_path_, bool include_ for(auto &child : children) { auto name = Glib::Markup::escape_text(child.get_value(column_record.name)); auto path = child.get_value(column_record.path); + // Use canonical path to follow symbolic links + boost::system::error_code ec; + auto canonical_path = boost::filesystem::canonical(path, ec); + if(ec) + canonical_path = path; + Gdk::RGBA *color; - if(status.modified.find(path.generic_string()) != status.modified.end()) + if(status.modified.find(canonical_path.generic_string()) != status.modified.end()) color = &yellow; - else if(status.added.find(path.generic_string()) != status.added.end()) + else if(status.added.find(canonical_path.generic_string()) != status.added.end()) color = &green; else color = &normal_color;