diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2017-02-16 13:47:50 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2017-02-16 13:47:50 -0700 |
commit | 590daafd769e06b834bd00433462168d700b9d92 (patch) | |
tree | c856b5ee868076c7b8036484dca972e26a398cb1 /bin/git-pull-safe | |
parent | 995813d15d1cb04015c5d93aefe6bf7bb9c3e75f (diff) | |
download | dotfiles-590daafd769e06b834bd00433462168d700b9d92.tar.gz |
pull-safe: do normal git before dgit
Diffstat (limited to 'bin/git-pull-safe')
-rwxr-xr-x | bin/git-pull-safe | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/bin/git-pull-safe b/bin/git-pull-safe index 22be76dd..f92f319f 100755 --- a/bin/git-pull-safe +++ b/bin/git-pull-safe @@ -20,18 +20,7 @@ function branch_remote() { current_branch="$(git rev-parse --abbrev-ref HEAD)" branches="$(git for-each-ref --format='%(refname:short)' refs/heads/)" -if [ "$(branch_prefix $current_branch)" = "dgit" ]; then - echo "I: current branch is $current_branch; doing \`dgit pull\`" - dgit pull -fi -for suite in $(git show-ref | grep refs/remotes/dgit/dgit | cut -d/ -f5 ); do - # skip if we just called `dgit pull` on this suite - if ! [ "$current_branch" = "dgit/$suite" ]; then - echo "I: fetching dgit suite $suite" - dgit fetch $suite - fi -done - +# (1) normal git branches git remote update for branch in $branches; do remote="$(branch_remote $branch 2>/dev/null || true)" @@ -43,3 +32,16 @@ for branch in $branches; do git merge-ff "$branch" fi done + +# (2) dgit branches +if [ "$(branch_prefix $current_branch)" = "dgit" ]; then + echo "I: current branch is $current_branch; doing \`dgit pull\`" + dgit pull +fi +for suite in $(git show-ref | grep refs/remotes/dgit/dgit | cut -d/ -f5 ); do + # skip if we just called `dgit pull` on this suite + if ! [ "$current_branch" = "dgit/$suite" ]; then + echo "I: fetching dgit suite $suite" + dgit fetch $suite + fi +done |