git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 1/2] must_commit_first: Make sure the index is up to date

From
Theodore Ts'o <tytso@mit.edu>
Date
Jul 8, 2008, 00:03 UTC
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" <tytso@mit.edu>
---
 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
Previous: Theodore Ts'oNext: Theodore Ts'o
Message 2 of 8 in “Two quick patches for guilt v0.30”
  1. Theodore Ts'oJul 8, 2008
  2. 1/2 must_commit_first: Make sure the index is up to dateTheodore Ts'o, Jul 8, 2008
  3. 2/2 Make guilt work even after git-sh-setup is moved out of the user's pathTheodore Ts'o, Jul 8, 2008
  4. Josef 'Jeff' SipekJul 8, 2008
  5. Junio C HamanoJul 8, 2008
  6. Josef 'Jeff' SipekJul 8, 2008
  7. Junio C HamanoJul 8, 2008
  8. Josef 'Jeff' SipekJul 8, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.