5
6
7
8
9
10
11
12
13
14
15
16
17
|
# File 'lib/jigit/git/post_checkout_hook.rb', line 5
def self.hook_lines
["#!/usr/bin/env bash",
"checkoutType=$3",
"[[ $checkoutType == 1 ]] && checkoutType='branch' || checkoutType='file'",
"if [ $checkoutType == 'branch' ]; then",
" newBranchName=`git symbolic-ref --short HEAD`",
" oldBranchName=`git rev-parse --abbrev-ref @{-1}`",
" if [ $newBranchName != $oldBranchName ]; then",
" jigit issue start --name=$newBranchName",
" jigit issue stop --name=$oldBranchName",
" fi",
"fi"]
end
|