Subject: [PATCH] cg-diff: Always refresh the cache before diffing

From: Jonas Fonseca <[email-masked]>
Date: Wed, 27 Apr 2005 01:01:57 +0200

Call update-cache --refresh before calling diff-cache so only modified
files are included in the diff.

Signed-off-by: Jonas Fonseca <[email-masked]>

---
commit 580058cf4cbb6c95e5e84480499ca1c635d99376
tree 57a559984564e31e79db28d9ad62b8ea3a55dda1
parent 74f5ad9d566408b4d352570ccde67ece0f2650a7
author Jonas Fonseca <[email-masked]> 1114555427 +0200
committer Jonas Fonseca <[email-masked]> 1114555427 +0200

 cg-diff |    4 +++-
 1 files changed, 3 insertions(+), 1 deletion(-)

Index: cg-diff
===================================================================
--- 7a6c485bceed70459c1855ab3c4d8ddfdeeb65d1/cg-diff  (mode:100755 sha1:b0c3e7389c06718c789e40b9a4fdce0afcb17917)
+++ 57a559984564e31e79db28d9ad62b8ea3a55dda1/cg-diff  (mode:100755 sha1:aecb9add527a72238f00c0581bf615625fec8663)
@@ -63,12 +63,14 @@
 		export GIT_INDEX_FILE=$(mktemp -t gitdiff.XXXXXX)
 		cp .git/index $GIT_INDEX_FILE
 		read-tree -m $(tree-id "$id1")
-		update-cache --refresh
 		tree=$(tree-id "$id1")
 	else
 		tree=$(tree-id)
 	fi
 
+	# Ensure to only diff modified files
+	update-cache --refresh
+
 	# FIXME: Update ret based on what did we match. And take "$@"
 	# to account after all.
 	ret=

-- 
Jonas Fonseca