title: Git throws 400 Bad Request when executed with sudo
body: <p>There is a weird error that we have been getting. </p>
  
  <p>I have compiled git 2.5.1 from source on Centos 6.5 where I also have Atlassian Stash running for the control and pushed the code into a repo. When I try to fetch or pull from the repo as a regular user or su everything works well. However when i use <code>sudo git fetch --all</code> it fails with <code>error: The requested URL returned error: 400 Bad Request while accessing http://stash.domain.com/scm/myr/myrepo.git/info/refs</code> </p>
  
  <p>What could be the problem here? </p>