<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -6,13 +6,11 @@ if [[ &quot;$1&quot; == &quot;-p&quot; ]]; then
     shift 1
 fi
 
-if [[ $# == 2 ]]; then
-    git checkout $2
-    echo ======================================================================
-fi
+HERE=$(pwd)
 
-if [[ $stat == true ]]; then
-    diff -w -U3 -r -x .git . &quot;$1&quot; | diffstat | grep -v only$
-else
-    diff -w -U3 -r -x .git . &quot;$1&quot;
-fi
+(cd &quot;$1&quot; &amp;&amp; git --git-dir=$HERE/.git diff ${2:-HEAD}) | \
+    if [[ $stat == true ]]; then \
+        diffstat | grep -v only$; \
+    else \
+        cat; \
+    fi</diff>
      <filename>git-diff-directory</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>3c301e7612297e213bf5f4257e211a100c3019f1</id>
    </parent>
  </parents>
  <author>
    <name>John Wiegley</name>
    <email>johnw@newartisans.com</email>
  </author>
  <url>http://github.com/jwiegley/git-scripts/commit/204893c548857ac38fa94ea2795da95aac1e0b4a</url>
  <id>204893c548857ac38fa94ea2795da95aac1e0b4a</id>
  <committed-date>2008-08-26T17:38:12-07:00</committed-date>
  <authored-date>2008-08-26T17:38:12-07:00</authored-date>
  <message>Increased performance by avoiding checkout.  Thanks to doener on #git.</message>
  <tree>8d9886030179ba1390f35c143fed6f5acd3eac33</tree>
  <committer>
    <name>John Wiegley</name>
    <email>johnw@newartisans.com</email>
  </committer>
</commit>
