Skip to content

Instantly share code, notes, and snippets.

@raszi
Last active May 18, 2016 07:39
Show Gist options
  • Save raszi/6d1a7700d7612c7e6d2b81cbce806e81 to your computer and use it in GitHub Desktop.
Save raszi/6d1a7700d7612c7e6d2b81cbce806e81 to your computer and use it in GitHub Desktop.
Test script for git-fresh
#!/bin/sh
set -e
TEST_DIR=$(mktemp -d)
pushd ${TEST_DIR}
git init && touch test && git add test && git commit -am 'Initial commit'
git checkout -b something && git checkout master && git-fresh && git checkout -
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
popd
rm -rf ${TEST_DIR}
[ ${CURRENT_BRANCH} == "master" ] && exit 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment