]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'ab/unused-script-helpers'
authorJunio C Hamano <gitster@pobox.com>
Thu, 23 Sep 2021 20:44:47 +0000 (13:44 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 23 Sep 2021 20:44:47 +0000 (13:44 -0700)
Code clean-up.

* ab/unused-script-helpers:
  test-lib: remove unused $_x40 and $_z40 variables
  git-bisect: remove unused SHA-1 $x40 shell variable
  git-sh-setup: remove unused "pull with rebase" message
  git-submodule: remove unused is_zero_oid() function

git-bisect.sh
git-sh-setup.sh
git-submodule.sh
t/test-lib.sh

index 6a7afaea8da09fa3fb3670d1a688421fbf152747..b59f3aaad438c80007be3d0c440f87c9467b6d7a 100755 (executable)
@@ -34,8 +34,6 @@ Please use "git help bisect" to get the full man page.'
 OPTIONS_SPEC=
 . git-sh-setup
 
-_x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'
-_x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40"
 TERM_BAD=bad
 TERM_GOOD=good
 
index 10d976418568556e83b47df89905a6a95a7d8915..cee053cdc388a9390ef4c23730d334e0bba376db 100644 (file)
@@ -223,9 +223,6 @@ require_clean_work_tree () {
                "rewrite branches")
                        gettextln "Cannot rewrite branches: You have unstaged changes." >&2
                        ;;
-               "pull with rebase")
-                       gettextln "Cannot pull with rebase: You have unstaged changes." >&2
-                       ;;
                *)
                        eval_gettextln "Cannot \$action: You have unstaged changes." >&2
                        ;;
@@ -242,9 +239,6 @@ require_clean_work_tree () {
                        rebase)
                                gettextln "Cannot rebase: Your index contains uncommitted changes." >&2
                                ;;
-                       "pull with rebase")
-                               gettextln "Cannot pull with rebase: Your index contains uncommitted changes." >&2
-                               ;;
                        *)
                                eval_gettextln "Cannot \$action: Your index contains uncommitted changes." >&2
                                ;;
index 27efdc57740fe408d629059cc57a52d0815e55b7..652861aa66a400940c24ea8405177f372009eafe 100755 (executable)
@@ -63,11 +63,6 @@ isnumber()
        n=$(($1 + 0)) 2>/dev/null && test "$n" = "$1"
 }
 
-# Given a full hex object ID, is this the zero OID?
-is_zero_oid () {
-       echo "$1" | sane_egrep '^0+$' >/dev/null 2>&1
-}
-
 # Sanitize the local git environment for use within a submodule. We
 # can't simply use clear_local_git_env since we want to preserve some
 # of the settings from GIT_CONFIG_PARAMETERS.
index d5ee9642548b56da72684df0b42b31e40059a69d..aa1ad8180ed877b51280ff908e30a81aa397715a 100644 (file)
@@ -534,7 +534,7 @@ SQ=\'
 # when case-folding filenames
 u200c=$(printf '\342\200\214')
 
-export _x05 _x35 _x40 _z40 LF u200c EMPTY_TREE EMPTY_BLOB ZERO_OID OID_REGEX
+export _x05 _x35 LF u200c EMPTY_TREE EMPTY_BLOB ZERO_OID OID_REGEX
 
 # Each test should start with something like this, after copyright notices:
 #
@@ -1425,10 +1425,9 @@ then
 fi
 
 # Convenience
-# A regexp to match 5, 35 and 40 hexdigits
+# A regexp to match 5 and 35 hexdigits
 _x05='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'
 _x35="$_x05$_x05$_x05$_x05$_x05$_x05$_x05"
-_x40="$_x35$_x05"
 
 test_oid_init
 
@@ -1437,7 +1436,6 @@ OID_REGEX=$(echo $ZERO_OID | sed -e 's/0/[0-9a-f]/g')
 OIDPATH_REGEX=$(test_oid_to_path $ZERO_OID | sed -e 's/0/[0-9a-f]/g')
 EMPTY_TREE=$(test_oid empty_tree)
 EMPTY_BLOB=$(test_oid empty_blob)
-_z40=$ZERO_OID
 
 # Provide an implementation of the 'yes' utility; the upper bound
 # limit is there to help Windows that cannot stop this loop from