Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 996 by sanfordarmstrong: post-review broken when run from root of  
git repo
http://code.google.com/p/reviewboard/issues/detail?id=996

Recently this was added to post-review:

         git_dir = execute(["git", "rev-parse", "--git-dir"],
         ignore_errors=True).strip()

         if git_dir.startswith("fatal:") or not os.path.isdir(git_dir):
         return None

         # post-review in directories other than the top level of
         # of a work-tree would result in broken diffs on the server
         os.chdir(os.path.dirname(git_dir))

The problem with this is that if you're in the root of your repo, git_dir
is set to ".git", and dirname returns an empty string, resulting in this
error when chdir is called:

   File "/home/sandy/bin/post-review", line 1596, in get_repository_info
     os.chdir(git_dir_name)
OSError: [Errno 2] No such file or directory: ''

I'm not a python or git expert, so I fixed this locally by changing that
last part to:

         # post-review in directories other than the top level of
         # of a work-tree would result in broken diffs on the server
         git_dir_name = os.path.dirname(git_dir)
         if git_dir_name != '':
                 os.chdir(git_dir_name)

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"reviewboard-issues" group.
To post to this group, send email to reviewboard-issues@googlegroups.com
To unsubscribe from this group, send email to 
reviewboard-issues+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/reviewboard-issues?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to