I suppose that if the condition is fulfilled then the previously obtained value will not be necessary. Signed-off-by: Vadim Petrov <tridronet@xxxxxxxxxxxxxx> --- setup.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.c b/setup.c index 8cc34186c..1ce0189fa 100644 --- a/setup.c +++ b/setup.c @@ -35,7 +35,6 @@ static int abspath_part_inside_repo(char *path) return -1; wtlen = strlen(work_tree); len = strlen(path); - off = offset_1st_component(path); /* check if work tree is already the prefix */ if (wtlen <= len && !strncmp(path, work_tree, wtlen)) { @@ -49,6 +48,8 @@ static int abspath_part_inside_repo(char *path) } /* work tree might match beginning of a symlink to work tree */ off = wtlen; + } else { + off = offset_1st_component(path); } path0 = path; path += off; -- 2.15.1.433.g936d1b989