]> git.ipfire.org Git - thirdparty/git.git/blobdiff - git-submodule.sh
rebase: prepare reset_head() for more flags
[thirdparty/git.git] / git-submodule.sh
index 1b568e29b9a09af9fdecf19ddb75ffd2bdc6e094..c09eb3e03d25510b2768d8f9c144cab2597fc000 100755 (executable)
@@ -82,6 +82,11 @@ 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.
@@ -780,7 +785,7 @@ cmd_summary() {
        while read -r mod_src mod_dst sha1_src sha1_dst status name
        do
                if test -z "$cached" &&
-                       test $sha1_dst = 0000000000000000000000000000000000000000
+                       is_zero_oid $sha1_dst
                then
                        case "$mod_dst" in
                        160000)