@@ -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
@@ -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
-}
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@gmail.com> --- contrib/subtree/git-subtree.sh | 12 ++++++++++++ git-sh-setup.sh | 12 ------------ 2 files changed, 12 insertions(+), 12 deletions(-)