Skip to content

Commit

Permalink
G2-338 Improved github jack error message
Browse files Browse the repository at this point in the history
  • Loading branch information
gdgib committed Apr 12, 2019
1 parent c6beea1 commit 3a2c8f4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions builtin/jack/github/jack
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ function import () {
BRANCH=$(git rev-parse --abbrev-ref HEAD)
if [ "${BRANCH}" != "${VERSION}" ]; then
echo -e "${CFMT_INFO}Switching to version ${VERSION}${CFMT_NORMAL}" >&2
set +e
if ! git show-ref | grep "/${VERSION}\$"; then
echo -e "${CFMT_ERROR}Version ${VERSION} could not be found!${CFMT_NORMAL}" >&2
exit 1
fi
set -e
REFSPEC=$(git show-ref | grep "/${VERSION}\$" | cut -f 2 -d ' ')
git checkout -b ${VERSION} ${REFSPEC} >&2
fi
Expand Down

0 comments on commit 3a2c8f4

Please sign in to comment.