diff --git a/branch b/branch new file mode 100755 index 0000000..d908108 --- /dev/null +++ b/branch @@ -0,0 +1,13 @@ +#!/bin/bash -e + +if [[ $# -eq 0 ]]; then + headref=$(./symbolic-ref HEAD | sed -e 's|^refs/heads/||') + echo "*$headref" + cd .zit/refs/heads + ls | grep -vxF $headref +else + branchname=$1 + startpoint=${2-HEAD} + rev=$(./rev-parse $startpoint) + ./update-ref refs/heads/$branchname $rev +fi