未验证 提交 4c2cd1a9 编写于 作者: S Sam Bent 提交者: GitHub

Improve pre-commit githook (#5813)

* improve pre-commit githook

* sort staged file list
上级 51f3ecc9
......@@ -187,9 +187,9 @@ src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Generated/Ima
src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Generated/ImageSource.cs
src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Generated/Int32Collection.cs
src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Generated/Int32CollectionConverter.cs
src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Generated/LinearGradientBrush.cs
src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Generated/LineGeometry.cs
src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Generated/LineSegment.cs
src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Generated/LinearGradientBrush.cs
src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Generated/MatrixTransform.cs
src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Generated/MediaTimeline.cs
src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Generated/PathFigure.cs
......@@ -345,9 +345,9 @@ src/Microsoft.DotNet.Wpf/src/Shared/MS/Internal/Generated/TextDecorationUnitVali
src/Microsoft.DotNet.Wpf/src/Shared/MS/Internal/Generated/TextHintingModeValidation.cs
src/Microsoft.DotNet.Wpf/src/Shared/MS/Internal/Generated/TextRenderingModeValidation.cs
src/Microsoft.DotNet.Wpf/src/Shared/MS/Internal/Generated/TileModeValidation.cs
src/Microsoft.DotNet.Wpf/src/System.Windows.Controls.Ribbon/MS/Internal/Generated/DoubleUtil.cs
src/Microsoft.DotNet.Wpf/src/System.Windows.Controls.Ribbon/Microsoft/Windows/Controls/Generated/PropertyHelper.cs
src/Microsoft.DotNet.Wpf/src/System.Windows.Controls.Ribbon/Microsoft/Windows/Controls/Generated/TreeHelper.cs
src/Microsoft.DotNet.Wpf/src/System.Windows.Controls.Ribbon/MS/Internal/Generated/DoubleUtil.cs
src/Microsoft.DotNet.Wpf/src/WindowsBase/System/Windows/Converters/Generated/Int32RectValueSerializer.cs
src/Microsoft.DotNet.Wpf/src/WindowsBase/System/Windows/Converters/Generated/PointValueSerializer.cs
src/Microsoft.DotNet.Wpf/src/WindowsBase/System/Windows/Converters/Generated/RectValueSerializer.cs
......
......@@ -28,7 +28,7 @@ REPO_ROOT=$(git rev-parse --show-toplevel | sort)
TEMP_FILE_FULL_PATH=$REPO_ROOT/$TEMP_FILE_NAME
# Create the temporary file containing a list of staged files(always overwrite)
echo "$STAGED_FILES" > "$TEMP_FILE_FULL_PATH"
echo "$STAGED_FILES" | sort > "$TEMP_FILE_FULL_PATH"
# Find any staged files that intersect with the generated file list
STAGED_GENERATED_FILES=$(comm -12 $TEMP_FILE_FULL_PATH $GENERATED_FILE_LIST)
......@@ -40,8 +40,9 @@ STAGED_GENERATED_FILES=$(comm -12 $TEMP_FILE_FULL_PATH $GENERATED_FILE_LIST)
# the user from committing their change locally.
if test -n "$STAGED_GENERATED_FILES"
then
echo "Error: WPF generated staged files detected. These files must not be modified."
echo "*** Commit aborted because it includes the following WPF generated staged files: "
echo "$STAGED_GENERATED_FILES"
echo "*** If you have generated them properly, use the '--no-verify' to override this check."
exit 1
fi
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册