git.c: simplify stripping extension of a file in handle_builtin()
commit63ca1c099c36e61b0e9cd7fa0b912c0b9d89b628
authorAlexander Kuleshov <kuleshovmail@gmail.com>
Mon, 22 Feb 2016 07:18:29 +0000 (22 13:18 +0600)
committerJunio C Hamano <gitster@pobox.com>
Mon, 22 Feb 2016 07:52:43 +0000 (21 23:52 -0800)
tree266daafe353b62f988436638e69fdeea41824862
parentbe08dee9738eaaa0423885ed189c2b6ad8368cf0
git.c: simplify stripping extension of a file in handle_builtin()

The handle_builtin() starts from stripping of command extension if
STRIP_EXTENSION is enabled. Actually STRIP_EXTENSION does not used
anywhere else.

This patch introduces strip_extension() helper to strip STRIP_EXTENSION
extension from argv[0] with the strip_suffix() instead of manually
stripping.

Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-compat-util.h
git.c