'rev-parse --git-dir' does not do something useful when using worktrees. Instead use cdup which prints enough ../'s to get to the top of the tree. Signed-off-by: Jason Gunthorpe <jgg@xxxxxxxxxxxx> --- buildlib/cbuild | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/buildlib/cbuild b/buildlib/cbuild index 6b6c5878bbd592..e1aecbaa0fdef5 100755 --- a/buildlib/cbuild +++ b/buildlib/cbuild @@ -872,8 +872,8 @@ if __name__ == '__main__': # This script must always run from the top of the git tree, and a git # checkout is mandatory. - git_top = subprocess.check_output(["git","rev-parse","--git-dir"]).strip(); - if git_top != ".git": - os.chdir(os.path.dirname(git_top)); + cdup = subprocess.check_output(["git","rev-parse","--show-cdup"]).strip(); + if cdup: + os.chdir(cdup); args.func(args); -- 2.16.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html