File: git-refactor

package info (click to toggle)
git-extras 1.7.0-1.2
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 696 kB
  • sloc: sh: 381; makefile: 52
file content (12 lines) | stat: -rwxr-xr-x 353 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/bash

if test "$1" = "finish"; then
  test -z $2 && echo "refactor <name> required." 1>&2 && exit 1
  branch=refactor/$2
  git merge --no-ff $branch && git delete-branch $branch
else
  test -z $1 && echo "refactor <name> required." 1>&2 && exit 1
  branch=refactor/$1
  git checkout -b $branch &> /dev/null
  git checkout $branch &> /dev/null
fi