From 8a21037ae3ca0d9dc74d9ea9ab515515a311670a Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Thu, 18 Apr 2013 18:37:59 -0400 Subject: [PATCH] r: handle random remotes better --- .bin/r | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.bin/r b/.bin/r index af59962..90452b2 100755 --- a/.bin/r +++ b/.bin/r @@ -165,6 +165,11 @@ g-push) if ! remote_branch=$(g cfg --get "branch.${branch}.merge") ; then err "could not figure out remote branch" fi + if ! remote=$(g cfg --get "branch.${branch}.remote") ; then + for remote in cros-internal cros origin ; do + g cfg --get "remote.${remote}.url" >/dev/null && break + done + fi remote_branch=${remote_branch#refs/heads/} git_args=() @@ -190,12 +195,7 @@ g-push) git_args+=( "--receive-pack=git receive-pack ${reviewers[*]/#/--reviewer=}" ) fi - for remote in cros-internal cros origin ; do - if g cfg --get "remote.${remote}.url" >/dev/null ; then - vr git push "${git_args[@]}" ${remote} ${branch}:refs/for/${remote_branch} - exit $? - fi - done + vr git push "${git_args[@]}" ${remote} ${branch}:refs/for/${remote_branch} && exit err "could not figure out remote to push to" ;; sync) -- 2.39.2