[gjs/iwyu-job: 5/8] CI: Refresh index before running git-diff-index



commit c7f8123d6ec9d8e0b535bcc1f8faecf43bc3182e
Author: Philip Chimento <philip chimento gmail com>
Date:   Wed Jun 3 14:27:55 2020 -0700

    CI: Refresh index before running git-diff-index
    
    Very obscure, but it seems that git-diff-index can think that every file
    in the index has been modified due to their mtime, even if their
    contents are the same. This seems to happen on CI, so refresh the index
    (using git's "convenient" --really-refresh switch).

 tools/run_iwyu.sh | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/tools/run_iwyu.sh b/tools/run_iwyu.sh
index f8d6a754..0ff6a5e1 100755
--- a/tools/run_iwyu.sh
+++ b/tools/run_iwyu.sh
@@ -14,6 +14,9 @@ fi
 if [ $# -eq 0 ]; then
     files=all
 else
+    # make stat changes not show up as modifications
+    git update-index -q --really-refresh
+
     files="$(git diff-tree --name-only -r $1..) $(git diff-index --name-only HEAD)"
 fi
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]