Move the peel_committish() function out of git-sh-setup to its only user, contrib/subtree/git-subtree.sh. Since d03ebd411c6 (rebase: remove the rebase.useBuiltin setting, 2019-03-18) when git-legacy-rebase.sh was removed, it has only been used in git-subtree.sh. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@xxxxxxxxx> --- contrib/subtree/git-subtree.sh | 12 ++++++++++++ git-sh-setup.sh | 12 ------------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh index 7f767b5c38f..a6deb57bcae 100755 --- a/contrib/subtree/git-subtree.sh +++ b/contrib/subtree/git-subtree.sh @@ -818,6 +818,18 @@ cmd_add_repository () { cmd_add_commit FETCH_HEAD } +peel_committish () { + case "$1" in + :/*) + peeltmp=$(git rev-parse --verify "$1") && + git rev-parse --verify "${peeltmp}^0" + ;; + *) + git rev-parse --verify "${1}^0" + ;; + esac +} + # Usage: cmd_add_commit REV cmd_add_commit () { # The rev has already been validated by cmd_add(), we just diff --git a/git-sh-setup.sh b/git-sh-setup.sh index 6a21238dc0e..9243353bc21 100644 --- a/git-sh-setup.sh +++ b/git-sh-setup.sh @@ -294,15 +294,3 @@ if test -z "$NONGIT_OK" then git_dir_init fi - -peel_committish () { - case "$1" in - :/*) - peeltmp=$(git rev-parse --verify "$1") && - git rev-parse --verify "${peeltmp}^0" - ;; - *) - git rev-parse --verify "${1}^0" - ;; - esac -} -- 2.33.0.814.gb82868f05f3