Skip to content

Commit

Permalink
branch
Browse files Browse the repository at this point in the history
  • Loading branch information
Joe Mou committed Apr 19, 2019
1 parent 51ca764 commit c3e61e2
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions branch
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit c3e61e2

Please sign in to comment.