() Jim Meyering <[EMAIL PROTECTED]>
() Thu, 27 Dec 2007 22:13:53 +0100

   [test case?]

thanks for looking into this.

below is a script (write to /tmp/z ; chmod +x) that shows little output
and exit code 0 with the patch and spurious "0 files changed" and exit
code 1 without.  i am curious how it behaves w/ other versions of git.

fyi, to simulate "without patch", i actually used the small mod:

  if (! total_files, 0)

which produced a compiler warning (of no consequence).

thi


______________________________________________________
#!/bin/sh
rm -rf /tmp/foo
mkdir /tmp/foo
cd /tmp/foo
git init
echo echo > echo
git add .
git commit -m'one'

sleep 1 # ymmv, munge to taste
touch echo

try ()
{
    git diff-index $1 -p --exit-code HEAD -- echo
    echo $?
}

try      --stat
try --shortstat

# /tmp/z ends here


Reply via email to