chiark / gitweb /
has_remote(): Introduce to check if branch has remote counterpart
[topgit.git] / tg-update.sh
index 912c968dbdce2b3ce35f08f2adfcbf82164fbff0..34fa6dcb10f59799e0df977e98544483cff3fc30 100644 (file)
@@ -100,8 +100,8 @@ merge_with="refs/top-bases/$name"
 
 ## Second, update our head with the remote branch
 
-rname="refs/remotes/$base_remote/$name"
-if [ -n "$base_remote" ] && ref_exists "$rname"; then
+if has_remote "$name"; then
+       rname="refs/remotes/$base_remote/$name"
        if branch_contains "$name" "$rname"; then
                info "The $name head is up-to-date wrt. its remote branch."
        else