class Jigit::PostCheckoutHook

Public Class Methods

hook_lines() click to toggle source
# 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
name() click to toggle source
# File lib/jigit/git/post_checkout_hook.rb, line 19
def self.name
  "post-checkout"
end