sgit-type 263 B

1234567891011
  1. #! /bin/bash
  2. [[ $# -ne 1 ]] && echo "Usage: $0 SHA1SUM
  3. Lists type of git object associated with SHA1SUM." && exit 1
  4. sha=$1
  5. [[ ! -f "$(sgit-loc $sha)" ]] && echo "No object is associated with sha1sum $sha." && exit 1
  6. sgit-cat $sha | head -1 | awk '{print $1}'