checkout: die_if_checked_out: simplify strbuf management
commit4e07815dba5ccad0cfcb672b99e2000bd3dc3543
authorEric Sunshine <sunshine@sunshineco.com>
Fri, 17 Jul 2015 22:59:59 +0000 (17 18:59 -0400)
committerJunio C Hamano <gitster@pobox.com>
Mon, 20 Jul 2015 18:29:24 +0000 (20 11:29 -0700)
treea5ba2f603431a4c60649911a1f53d1fb5ea4d6aa
parentaaad2c948f11cd57348135fb1e62b012db716182
checkout: die_if_checked_out: simplify strbuf management

There is no reason to keep the strbuf active long after its last use.
By releasing it as early as possible, resource management is simplified
and there is less worry about future changes resulting in a leak.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/checkout.c