From: Theodore Ts'o Date: Tue, 08 Jul 2008 00:03:11 GMT Subject: [PATCH 1/2] must_commit_first: Make sure the index is up to date Message-ID: <1215475392-26221-2-git-send-email-tytso@mit.edu> In-Reply-To: <1215475392-26221-1-git-send-email-tytso@mit.edu> git diff-files can be confused if the index is not up to date, so make sure it is updated first. Signed-off-by: "Theodore Ts'o" --- guilt | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/guilt b/guilt index 50414a4..cdf4e9b 100755 --- a/guilt +++ b/guilt @@ -495,6 +495,7 @@ s/^\([0-9]\{4\}\)-\([0-9]\{2\}\)-\([0-9]\{2\}\) \([0-9]\{2\}\):\([0-9]\{2\}\):\( # usage: must_commit_first must_commit_first() { + git update-index --refresh --unmerged -q > /dev/null [ `git diff-files | wc -l` -eq 0 ] return $? } -- 1.5.6.1.205.ge2c7.dirty