#!/bin/bash -e # this is not an actual git subcommand but implements a C function # sha1_name.c:get_sha1_basic if [[ ${#1} -eq 40 ]]; then echo $1 else cat .zit/$(symbolic-ref $1) 2> /dev/null || cat .zit/$(symbolic-ref refs/heads/$1) fi