1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

hack/validate/vendor: print diff for modified files

In case some files were modified (rather than merely added
or removed), we're curious to see the diff for those.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
Kir Kolyshkin 2019-10-28 19:18:23 -07:00
parent 9e7d5ac5ea
commit 9d4e81e8bf

View file

@ -13,6 +13,7 @@ validate_vendor_diff(){
vndr vndr
# check if any files have changed # check if any files have changed
diffs="$(git status --porcelain -- vendor 2>/dev/null)" diffs="$(git status --porcelain -- vendor 2>/dev/null)"
mfiles="$(echo "$diffs" | awk '/^ M / {print $2}')"
if [ "$diffs" ]; then if [ "$diffs" ]; then
{ {
echo 'The result of vndr differs' echo 'The result of vndr differs'
@ -21,6 +22,9 @@ validate_vendor_diff(){
echo echo
echo 'Please vendor your package with github.com/LK4D4/vndr.' echo 'Please vendor your package with github.com/LK4D4/vndr.'
echo echo
if [ -n "$mfiles" ] ; then
git diff -- "$mfiles"
fi
} >&2 } >&2
false false
else else