diff options
author | Junio C Hamano <gitster@pobox.com> | 2021-09-23 22:44:47 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-09-23 22:44:47 +0200 |
commit | 57e4a7b633d00f274051d436edcec14ad98969c3 (patch) | |
tree | 1773a65b46fb416f3c93f2acb232d36fba2b05cf | |
parent | Merge branch 'ab/http-drop-old-curl-plus' (diff) | |
parent | test-lib: remove unused $_x40 and $_z40 variables (diff) | |
download | git-57e4a7b633d00f274051d436edcec14ad98969c3.tar.xz git-57e4a7b633d00f274051d436edcec14ad98969c3.zip |
Merge branch 'ab/unused-script-helpers'
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
-rwxr-xr-x | git-bisect.sh | 2 | ||||
-rw-r--r-- | git-sh-setup.sh | 6 | ||||
-rwxr-xr-x | git-submodule.sh | 5 | ||||
-rw-r--r-- | t/test-lib.sh | 6 |
4 files changed, 2 insertions, 17 deletions
diff --git a/git-bisect.sh b/git-bisect.sh index 6a7afaea8d..b59f3aaad4 100755 --- a/git-bisect.sh +++ b/git-bisect.sh @@ -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 diff --git a/git-sh-setup.sh b/git-sh-setup.sh index 10d9764185..cee053cdc3 100644 --- a/git-sh-setup.sh +++ b/git-sh-setup.sh @@ -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 ;; diff --git a/git-submodule.sh b/git-submodule.sh index 27efdc5774..652861aa66 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -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. diff --git a/t/test-lib.sh b/t/test-lib.sh index d5ee964254..aa1ad8180e 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -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 |