Skip to content

Commit

Permalink
Be verbose when !initial commit
Browse files Browse the repository at this point in the history
verbose option in git-commit.sh lead us to run git-diff-index, which
needs a commit-ish we are making diff against.  When we are commiting
the fist set, we obviously don't have any commit-ish in the repo.  So
we just skip the git-diff-index run.

It might be possible to produce diff against empty but do we need
that?

Signed-off-by: Yasushi SHOJI <yashi@atmark-techno.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Yasushi SHOJI authored and Junio C Hamano committed Mar 20, 2006
1 parent 3070b60 commit 1fa7a68
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion git-commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ run_status () {
}
'

if test -n "$verbose"
if test -n "$verbose" -a -z "$IS_INITIAL"
then
git-diff-index --cached -M -p --diff-filter=MDTCRA $REFERENCE
fi
Expand Down

0 comments on commit 1fa7a68

Please sign in to comment.