run-command: optimize out useless shell calls
authorJeff King <peff@peff.net>
Wed, 30 Dec 2009 10:55:36 +0000 (05:55 -0500)
committerJunio C Hamano <gitster@pobox.com>
Wed, 6 Jan 2010 07:41:50 +0000 (23:41 -0800)
commitf445644fd28d31a828731a618e9a9c79be89efd2
tree19f58a2063483bbe12e84f606145f267fa5b2a40
parentac0ba18df0c58decfb128336bab51a172c77abc0
run-command: optimize out useless shell calls

If there are no metacharacters in the program to be run, we
can just skip running the shell entirely and directly exec
the program.

The metacharacter test is pulled verbatim from
launch_editor, which already implements this optimization.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
run-command.c