reset $pathspec: exit with code 0 if successful
authorMartin von Zweigbergk <martinvonz@gmail.com>
Tue, 15 Jan 2013 05:47:34 +0000 (21:47 -0800)
committerJunio C Hamano <gitster@pobox.com>
Tue, 15 Jan 2013 17:38:07 +0000 (09:38 -0800)
commitd94c5e2fa24dce13a3dc1ba178f381cb09bb0853
tree97c3a045e9e613d8fd74fce6c52fb6524d9b0459
parent10746a361689aaa1aa98b8d4e7fb3b8463391864
reset $pathspec: exit with code 0 if successful

"git reset $pathspec" currently exits with a non-zero exit code if the
worktree is dirty after resetting, which is inconsistent with reset
without pathspec, and it makes it harder to know whether the command
really failed. Change it to exit with code 0 regardless of whether the
worktree is dirty so that non-zero indicates an error.

This makes the 4 "disambiguation" test cases in t7102 clearer since
they all used to "fail", 3 of which "failed" due to changes in the
work tree. Now only the ambiguous one fails.

Signed-off-by: Martin von Zweigbergk <martinvonz@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/reset.c
t/t2013-checkout-submodule.sh
t/t7102-reset.sh