OSDN Git Service

Merge branch 'we/submodule-update-prefix-output' into maint
authorJunio C Hamano <gitster@pobox.com>
Tue, 26 Mar 2013 19:44:26 +0000 (12:44 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 26 Mar 2013 19:44:27 +0000 (12:44 -0700)
"git submodule update", when recursed into sub-submodules, did not
acccumulate the prefix paths.

* we/submodule-update-prefix-output:
  submodule update: when using recursion, show full path

1  2 
git-submodule.sh
t/t7406-submodule-update.sh

@@@ -659,23 -624,9 +659,23 @@@ Maybe you want to use 'update --init'?"
                else
                        subsha1=$(clear_local_git_env; cd "$sm_path" &&
                                git rev-parse --verify HEAD) ||
-                       die "$(eval_gettext "Unable to find current revision in submodule path '\$sm_path'")"
+                       die "$(eval_gettext "Unable to find current revision in submodule path '\$prefix\$sm_path'")"
                fi
  
 +              if test -n "$remote"
 +              then
 +                      if test -z "$nofetch"
 +                      then
 +                              # Fetch remote before determining tracking $sha1
 +                              (clear_local_git_env; cd "$sm_path" && git-fetch) ||
 +                              die "$(eval_gettext "Unable to fetch in submodule path '\$sm_path'")"
 +                      fi
 +                      remote_name=$(clear_local_git_env; cd "$sm_path" && get_default_remote)
 +                      sha1=$(clear_local_git_env; cd "$sm_path" &&
 +                              git rev-parse --verify "${remote_name}/${branch}") ||
 +                      die "$(eval_gettext "Unable to find current ${remote_name}/${branch} revision in submodule path '\$sm_path'")"
 +              fi
 +
                if test "$subsha1" != "$sha1" -o -n "$force"
                then
                        subforce=$force
Simple merge