From 09be17de09049a77c085f0cf7b5eb11d0c63b1f9 Mon Sep 17 00:00:00 2001 From: Ulrich Huber Date: Sat, 15 Jun 2019 17:53:22 +0200 Subject: [PATCH] Fix wrong var check in clang-pipeline --- azure-pipelines/clang-format-applied.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-pipelines/clang-format-applied.yml b/azure-pipelines/clang-format-applied.yml index 626119ca..f656c0fb 100644 --- a/azure-pipelines/clang-format-applied.yml +++ b/azure-pipelines/clang-format-applied.yml @@ -23,14 +23,14 @@ stages: git fetch origin +$(Build.SourceBranch) echo "List of modified files:" - git --no-pager diff --name-only FETCH_HEAD $(git merge-base FETCH_HEAD $(System.PullRequest.TargetBranch)) + git --no-pager diff --name-only FETCH_HEAD $(git merge-base FETCH_HEAD $(System.PullRequest.TargetBranch)) | grep ".cpp$\|.hpp$\|.h$ # Actually get the list in a parsable state LOMF=$(git --no-pager diff --name-only FETCH_HEAD $(git merge-base FETCH_HEAD $(System.PullRequest.TargetBranch)) | grep ".cpp$\|.hpp$\|.h$") # Checkout the PR again so we can check the modified files for correct format git checkout FETCH_HEAD - if [ -n "$VAR" ]; then + if [ -n "$LOMF" ]; then # Apply clang-format to enforce proper format clang-format -i -style=file $LOMF # All previously badly formatted files should now be modified