File: pre-commit

package info (click to toggle)
git-ubuntu 1.1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,688 kB
  • sloc: python: 13,378; sh: 480; makefile: 2
file content (16 lines) | stat: -rwxr-xr-x 525 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh

EMPTY_TREE=4b825dc642cb6eb9a060e54bf8d69288fbee4904

if git ls-tree -r -d HEAD|awk '{print $3}'|grep -q $EMPTY_TREE; then
    echo "ERROR: Empty directories exist and will disappear on commit, causing" >&2
    echo "extraneous unintended changes:" >&2
    echo >&2
    git ls-tree -r -d HEAD|grep $EMPTY_TREE|awk '{print $4}' >&2
    echo >&2
    echo "See LP: #1687057." >&2
    echo 'Use "git commit --no-verify ..." to ignore this problem.' >&2
    echo >&2
    echo "pre-commit hook failed." >&2
    exit 1
fi