subtree: don't have loose code outside of a function
commit5a3569774f7b6dcdbdf470ae1e40367200d987ec
authorLuke Shumaker <lukeshu@datawire.io>
Tue, 27 Apr 2021 21:17:30 +0000 (27 15:17 -0600)
committerJunio C Hamano <gitster@pobox.com>
Wed, 28 Apr 2021 07:47:17 +0000 (28 16:47 +0900)
treeb75f921ff9c774049433b547ae670bfb1cab292b
parentb04538d99f07a2ac39a5314ec76bc9f07e5fd686
subtree: don't have loose code outside of a function

Shove all of the loose code inside of a main() function.

This comes down to personal preference more than anything else.  A
preference that I've developed over years of maintaining large Bash
scripts, but still a mere personal preference.

In this specific case, it's also moving the `set -- -h`, the `git
rev-parse --parseopt`, and the `. git-sh-setup` to be closer to all
the rest of the argument parsing, which is a readability win on its
own, IMO.

"Ignore space change" is probably helpful when viewing this diff.

Signed-off-by: Luke Shumaker <lukeshu@datawire.io>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/subtree/git-subtree.sh