Permalink
Browse files

remove obsolete loop from determine_remote_branch

- can cause extraneous output for branches that have never been checked out
  • Loading branch information...
1 parent 600f91f commit 7817ed12f75b60c7db8a20ad6df38c0be2db395b @handcraftsman handcraftsman committed Mar 3, 2012
Showing with 2 additions and 13 deletions.
  1. +2 −13 scripts/git.lib
View
@@ -29,19 +29,8 @@ require_clean_work_tree () {
determine_remote_branch () {
remoteBranches="$(git branch -r | grep -v 'HEAD' | tr '/' ' ' | awk '{print $2}')"
- for branch in ${remoteBranches}
- do
- if [ "${CURRENT}" == "$(git branch --contains ${branch} | grep '\*' | awk '{print $2}')" ]
- then
- remote=$branch
- return
- fi
- done
- if [ -z "$remote" ]
- then
- currentBranches="$(git branch --contains ${CURRENT} | grep -v '\*' | awk '{print $1}')"
- remote="$(echo ${remoteBranches} ${currentBranches} | tr ' ' '\n' | sort | uniq -c | grep "2" | awk '{print $2}' | head -1)"
- fi
+ currentBranches="$(git branch --contains ${CURRENT} | grep -v '\*' | awk '{print $1}')"
+ remote="$(echo ${remoteBranches} ${currentBranches} | tr ' ' '\n' | sort | uniq -c | grep "2" | awk '{print $2}' | head -1)"
if [ -z "$remote" ]
then
mergeBases=""

0 comments on commit 7817ed1

Please sign in to comment.