diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/hooks/pre-commit | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/examples/hooks/pre-commit b/examples/hooks/pre-commit index dc79432..e4cc8ea 100644 --- a/examples/hooks/pre-commit +++ b/examples/hooks/pre-commit @@ -24,6 +24,18 @@ exit_on_fail() { fi } +if git rev-parse MERGE_HEAD >/dev/null 2>&1 \ + && [ -e "$MSFILE" ] \ + && ! metastore -c -q -f "$MSFILE"; then + echo "In git Conflict resolution, and saved metadata does not match filesystem" + echo "metadata. Unable to fix automatically. Try:" + echo " metastore -cf \"$MSFILE\" -- Shows where the differences are" + echo " metastore -df \"$MSFILE\" -- Shows the stored metadata" + echo " metastore -sf \"$MSFILE\" -- Save current filesystem metadata as-is" + echo " metastore -af \"$MSFILE\" -- Apply saved metadata to filesystem" + exit 1 +fi + exit_on_fail \ metastore -s -f "$MSFILE" |