diff options
author | Junio C Hamano <gitster@pobox.com> | 2011-04-04 03:41:24 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-04-04 03:41:24 -0700 |
commit | 1eb71bc0ec609c67b8a308f9267691144a48bffd (patch) | |
tree | 85e1c1054de559a38f2f620fcdf103ccf8f2467d /git-submodule.sh | |
parent | 44bc573436c98b7c6cd798af04c538f6e76f0f6e (diff) | |
parent | 313ee0d69f58c2bf2f4e0a62b812c9d08a39b240 (diff) | |
download | git-1eb71bc0ec609c67b8a308f9267691144a48bffd.tar.gz |
Merge branch 'nm/maint-conflicted-submodule-entries'
* nm/maint-conflicted-submodule-entries:
submodule: process conflicting submodules only once
Diffstat (limited to 'git-submodule.sh')
-rwxr-xr-x | git-submodule.sh | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/git-submodule.sh b/git-submodule.sh index 3a13397e05..7f6b3cf207 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -72,7 +72,24 @@ resolve_relative_url () # module_list() { - git ls-files --error-unmatch --stage -- "$@" | sane_grep '^160000 ' + git ls-files --error-unmatch --stage -- "$@" | + perl -e ' + my %unmerged = (); + my ($null_sha1) = ("0" x 40); + while (<STDIN>) { + chomp; + my ($mode, $sha1, $stage, $path) = + /^([0-7]+) ([0-9a-f]{40}) ([0-3])\t(.*)$/; + next unless $mode eq "160000"; + if ($stage ne "0") { + if (!$unmerged{$path}++) { + print "$mode $null_sha1 U\t$path\n"; + } + next; + } + print "$_\n"; + } + ' } # @@ -427,6 +444,11 @@ cmd_update() module_list "$@" | while read mode sha1 stage path do + if test "$stage" = U + then + echo >&2 "Skipping unmerged submodule $path" + continue + fi name=$(module_name "$path") || exit url=$(git config submodule."$name".url) update_module=$(git config submodule."$name".update) @@ -770,6 +792,11 @@ cmd_status() name=$(module_name "$path") || exit url=$(git config submodule."$name".url) displaypath="$prefix$path" + if test "$stage" = U + then + say "U$sha1 $displaypath" + continue + fi if test -z "$url" || ! test -d "$path"/.git -o -f "$path"/.git then say "-$sha1 $displaypath" |