reset.c: share call to die_if_unmerged_cache()
commit352f58a57ba3050adbdc2dcdcd3839e584f1431b
authorMartin von Zweigbergk <martinvonz@gmail.com>
Tue, 15 Jan 2013 05:47:40 +0000 (14 21:47 -0800)
committerJunio C Hamano <gitster@pobox.com>
Tue, 15 Jan 2013 17:38:07 +0000 (15 09:38 -0800)
treec5da0826a6d52c88d25b41e49bb359a5cd9543b1
parent7bca0e451b8e502fa882b458d6fc825da80034cb
reset.c: share call to die_if_unmerged_cache()

Use a single condition to guard the call to die_if_unmerged_cache for
both --soft and --keep. This avoids the small distraction of the
precondition check from the logic following it.

Also change an instance of

  if (e)
    err = err || f();

to the almost as short, but clearer

  if (e && !err)
    err = f();

(which is equivalent since we only care whether exit code is 0)

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