From 1c13daeb6eaf64109dcc3447e4f7381aec904a2a Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Mon, 25 Jun 2018 17:12:05 -0700 Subject: [PATCH] Added gitRefreshIndex task. --- build.gradle.kts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/build.gradle.kts b/build.gradle.kts index 0ffe6dd..210513f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -106,9 +106,15 @@ tasks { mustRunAfter("clean") } + val gitRefreshIndex by creating(Exec::class) { + description = "Refreshes the git index." + commandLine("git", "update-index", "--refresh").isIgnoreExitValue = true + } + val gitIsDirty by creating(Exec::class) { description = "Fails if git has uncommitted changes." group = "verification" + dependsOn(gitRefreshIndex) commandLine("git", "diff-index", "--quiet", "HEAD", "--") }