Sha256: 055314c91277e9184a0790b5c81e0d56b5ead21173197fba0dcecaf3fd4a6573

Contents?: true

Size: 558 Bytes

Versions: 3

Compression:

Stored size: 558 Bytes

Contents

#!/bin/bash

# Run updates on new changes
branch_name=$(git branch | grep "*" | sed "s/\* //")
reflog_message=$(git reflog -1)
merged_branch_name=$(echo $reflog_message | cut -d" " -f 4 | sed "s/://")

# if the merge was caused by a "git pull", we can safely ignore it
if [[ $reflog_message =~ "merge" ]]; then
  echo "We support only pull"
    exit 0
fi

if [[ $branch_name == "master" ]]; then
  bin/update
  bin/rake db:reset

  echo "Removing merged branches..."
  git branch --merged master | grep -v "\*" | grep -v master | xargs -n 1 git branch -d
fi

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
jt_tools-0.0.5 lib/install/bin/git-hooks/post-merge.sample
jt_tools-0.0.4 lib/install/bin/git-hooks/post-merge.sample
jt_tools-0.0.3 lib/install/bin/git-hooks/post-merge.sample