File: has-git-commit

package info (click to toggle)
git-extras 7.4.0-1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 2,120 kB
  • sloc: sh: 4,312; python: 994; makefile: 146
file content (14 lines) | stat: -rw-r--r-- 246 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#
# check whether current directory contains any git commit
#

has_git_commit() {
  git rev-parse --short HEAD > /dev/null 2>&1
  result=$?
  if test $result != 0; then
    >&2 echo 'Not git commit found!'
    exit $result
  fi
}

has_git_commit