Skip to content

Commit

Permalink
Merge branch 'sb/submodule-init' into next
Browse files Browse the repository at this point in the history
Update of "git submodule" to move pieces of logic to C continues.

* sb/submodule-init:
  submodule init: redirect stdout to stderr
  • Loading branch information
gitster committed May 3, 2016
2 parents 21f6c40 + c66410e commit 8a5fce4
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
3 changes: 2 additions & 1 deletion builtin/submodule--helper.c
Expand Up @@ -366,7 +366,8 @@ static void init_submodule(const char *path, const char *prefix, int quiet)
die(_("Failed to register url for submodule path '%s'"),
displaypath);
if (!quiet)
printf(_("Submodule '%s' (%s) registered for path '%s'\n"),
fprintf(stderr,
_("Submodule '%s' (%s) registered for path '%s'\n"),
sub->name, url, displaypath);
}

Expand Down
24 changes: 18 additions & 6 deletions t/t7406-submodule-update.sh
Expand Up @@ -108,24 +108,36 @@ pwd=$(pwd)

cat <<EOF >expect
Submodule path '../super': checked out '$supersha1'
Submodule 'merging' ($pwd/merging) registered for path '../super/merging'
Submodule 'none' ($pwd/none) registered for path '../super/none'
Submodule 'rebasing' ($pwd/rebasing) registered for path '../super/rebasing'
Submodule 'submodule' ($pwd/submodule) registered for path '../super/submodule'
Submodule path '../super/merging': checked out '$mergingsha1'
Submodule path '../super/none': checked out '$nonesha1'
Submodule path '../super/rebasing': checked out '$rebasingsha1'
Submodule path '../super/submodule': checked out '$submodulesha1'
EOF

cat <<EOF >expect2
Submodule 'merging' ($pwd/merging) registered for path '../super/merging'
Submodule 'none' ($pwd/none) registered for path '../super/none'
Submodule 'rebasing' ($pwd/rebasing) registered for path '../super/rebasing'
Submodule 'submodule' ($pwd/submodule) registered for path '../super/submodule'
Cloning into '$pwd/recursivesuper/super/merging'...
done.
Cloning into '$pwd/recursivesuper/super/none'...
done.
Cloning into '$pwd/recursivesuper/super/rebasing'...
done.
Cloning into '$pwd/recursivesuper/super/submodule'...
done.
EOF

test_expect_success 'submodule update --init --recursive from subdirectory' '
git -C recursivesuper/super reset --hard HEAD^ &&
(cd recursivesuper &&
mkdir tmp &&
cd tmp &&
git submodule update --init --recursive ../super >../../actual
git submodule update --init --recursive ../super >../../actual 2>../../actual2
) &&
test_cmp expect actual
test_cmp expect actual &&
test_cmp expect2 actual2
'

apos="'";
Expand Down

0 comments on commit 8a5fce4

Please sign in to comment.