Q:

Capistrano failing to "git ls-remote ..." with "no returned status code..."

Can anyone help me understand what is going on here? Jenkins has been working perfectly for a while now and all of a sudden I keep getting this problem. Yes, I did try searching for the issue but it seems I am the only one who has ever had it because I can not find any info on it anywhere.
Please note, some of the info below has been changed for privacy issues, but my main concern is the message "no returned status code pid 74937 exit 2" that keeps being added to the git ls-remote command. I have no idea where that is coming from, or what it means.
I should note that I CAN "cap deploy" just fine from my local machine. I do not get any errors and the app is deployed to the remote server.
Any info would help, thanks.
* executing `deploy'
* executing `deploy:update'
** transaction: start
* executing `deploy:update_code'
updating the cached checkout on all servers
executing locally: "git ls-remote git@github.com:private/repo.git (no"
sh: -c: line 0: syntax error near unexpected token `('
sh: -c: line 0: `git ls-remote git@github.com:private/repo.git (no'
*** [deploy:update_code] rolling back
* executing "rm -rf /rails_apps/private/releases/20120624130104; true"
servers: ["SERVER_IP"]
[SERVER_IP] executing command
command finished in 529ms
Command git ls-remote git@github.com:private/repo.git (no returned status code pid 74937 exit 2

A:

So it turns out I forgot about some code I added to my deploy.rb to determine what brach I was on when deploying. Well, capistrano was obviously having issue finding the current branch. I was able to resolve this issue by adding the following...
def determine_branch
  git_branch = $1 if `git branch` =~ /\* (\S+)\s/m
  if git_branch =~ /no/
    "master"
  else
    git_branch
  end
end

