#!/bin/sh

merge_ts() {
    stat -f "%m" "$MERGED"
}

GF_MTIME_START=$(merge_ts)

"/usr/local/bin/juxta" \
    "_mergetool" \
    --base "${BASE:-/dev/null}" \
    --local "$LOCAL" \
    --remote "$REMOTE" \
    --merged "${MERGED:-/dev/null}"

GF_MTIME_END=$(merge_ts)

if [ $GF_MTIME_END -gt $GF_MTIME_START ]; then
    exit 0
fi

exit 1
