--- /dev/null
+When I try to do set-root on a git repository, I get:
+# be set-root .
+Traceback (most recent call last):
+ File "/usr/local/bin/be", line 55, in <module>
+ sys.exit(execute(sys.argv[1], sys.argv[2:]))
+ File "/usr/lib/python2.5/site-packages/libbe/cmdutil.py", line 105, in execute
+ File "/usr/lib/python2.5/site-packages/becommands/set_root.py", line 57, in execute
+ File "/usr/lib/python2.5/site-packages/libbe/bugdir.py", line 110, in create_bug_dir
+ File "/usr/lib/python2.5/site-packages/libbe/bugdir.py", line 70, in set_version
+ File "/usr/lib/python2.5/site-packages/libbe/git.py", line 51, in set_file_contents
+ File "/usr/lib/python2.5/site-packages/libbe/git.py", line 38, in add_id
+ File "/usr/lib/python2.5/site-packages/libbe/git.py", line 33, in invoke_client
+ File "/usr/lib/python2.5/site-packages/libbe/rcs.py", line 63, in invoke
+ File "/usr/lib/python2.5/subprocess.py", line 594, in __init__
+ errread, errwrite)
+ File "/usr/lib/python2.5/subprocess.py", line 1147, in _execute_child
+ raise child_exception
+OSError: [Errno 2] No such file or directory: ''
+
+because the cwd argument for Popen is set to '' (the empty string).
+
+The following patch fixes the issue:
+--- libbe/git.py 2008-06-22 19:52:14.000000000 -0400
++++ libbe/git.py 2008-06-23 00:53:39.000000000 -0400
+@@ -26,7 +26,7 @@
+ return filename
+
+ def invoke_client(*args, **kwargs):
+- directory = kwargs['directory']
++ directory = kwargs['directory'] or None
+ expect = kwargs.get('expect', (0, 1))
+ cl_args = ["git"]
+ cl_args.extend(args)
+
--- /dev/null
+It looks like the problems with the git backend are more than just in the
+site-init command. It looks like several places expect that git_dir_for_path
+and git_repo_for_path return absolute paths, while in the current
+implementation, it may not be the case. Here is an updated patch to fix this.
+This replaces the previous patch that I gave in this bug. It seems to work for
+me, but I haven't heavily tested it.
+
+--- libbe/git.py 2008-06-22 19:52:14.000000000 -0400
++++ /libbe/git.py 2008-06-23 22:39:17.000000000 -0400
+@@ -102,11 +102,16 @@
+ """Find the root of the deepest repository containing path."""
+ # Assume that nothing funny is going on; in particular, that we aren't
+ # dealing with a bare repo.
+- return os.path.dirname(git_dir_for_path(path))
++ # "git rev-parse --show-cdup" gives the relative path to the top-level
++ # directory of the repository. We then join that to the requested path,
++ # and then use realpath to turn it into an absolute path and to get rid of
++ # ".." components.
++ return os.path.realpath(os.path.join(path,invoke_client("rev-parse", "--show-cdup", directory=path)[1].rstrip()))
+
+ def git_dir_for_path(path):
+ """Find the git-dir of the deepest repo containing path."""
+- return invoke_client("rev-parse", "--git-dir", directory=path)[1].rstrip()
++ repo = git_repo_for_path(path)
++ return os.path.join(repo,invoke_client("rev-parse", "--git-dir", directory=repo)[1].rstrip())
+
+ def export(spec, bug_dir, revision_dir):
+ """Check out commit 'spec' from the git repo containing bug_dir into
+