rev-parse: take prefix into account in --git-common-dir
commit17f1365dbce9aa00cab3f196e7fa7138d9081eef
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Fri, 12 Feb 2016 04:31:45 +0000 (12 11:31 +0700)
committerJunio C Hamano <gitster@pobox.com>
Sat, 13 Feb 2016 00:01:47 +0000 (12 16:01 -0800)
tree8d66e92d668049ec01b4d970d8fcc0506e0b1b99
parent754884255bb580df159e58defa81cdd30b5c430c
rev-parse: take prefix into account in --git-common-dir

Most of the time, get_git_common_dir() returns an absolute path so
prefix is irrelevant. If it returns a relative path (e.g. from the
main worktree) then prefixing is required.

Noticed-by: Mike Hommey <mh@glandium.org>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/rev-parse.c
t/t2027-worktree-list.sh