I have a git post receive hook that will trigger a build on my build system.
I need to create a string of the form \"$repo-name + $branch\" in the hook script.
You could do git rev-parse --show-toplevel, which will give you the path of the top-level directory, and pull the name out of that (reponame.git is conventional for remotely-accessible repos).
$PWD might also have the same information, but I'm unsure.