From 15abc40983c1fe3e83ac7d387152c2beb764eb72 Mon Sep 17 00:00:00 2001 From: Noah Masur <7386960+nmasur@users.noreply.github.com> Date: Thu, 22 Apr 2021 09:46:59 -0400 Subject: [PATCH] shellcheck git push set upstream --- bin/git_set_upstream | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/git_set_upstream b/bin/git_set_upstream index d304b9f..553f3c8 100755 --- a/bin/git_set_upstream +++ b/bin/git_set_upstream @@ -1,12 +1,12 @@ -#!/bin/bash +#!/bin/sh # Copied from David Pedersen: https://github.com/davidpdrsn/dotfiles/blob/master/bin/git-pp set -e -function git_branch_name { - val=`git branch 2>/dev/null | grep '^*' | colrm 1 2` +git_branch_name() { + val=$( git branch 2>/dev/null | grep '^\*' | colrm 1 2 ) echo "$val" } -git push --set-upstream origin $(git_branch_name) +git push --set-upstream origin "$(git_branch_name)"