--- v4
+++ v2
@@ -6,14 +6,14 @@
Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
---
- t/t7400-submodule-basic.sh | 40 +++++++++++++++-----------------------
- 1 file changed, 16 insertions(+), 24 deletions(-)
+ t/t7400-submodule-basic.sh | 37 +++++++++++++++----------------------
+ 1 file changed, 15 insertions(+), 22 deletions(-)
diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh
-index cb1b8e35db..d69a5c0032 100755
+index a924fdb7a6..f5dc051a6e 100755
--- a/t/t7400-submodule-basic.sh
+++ b/t/t7400-submodule-basic.sh
-@@ -107,23 +107,15 @@ test_expect_success 'setup - repository to add submodules to' '
+@@ -107,25 +107,18 @@ test_expect_success 'setup - repository to add submodules to' '
# generates, which will expand symbolic links.
submodurl=$(pwd -P)
@@ -22,9 +22,9 @@
-}
-
inspect() {
-- dir=$1 &&
+ dir=$1 &&
- dotdot="${2:-..}" &&
--
+
- (
- cd "$dir" &&
- listbranches >"$dotdot/heads" &&
@@ -34,18 +34,19 @@
- git diff-files --exit-code &&
- git clean -n -d -x >"$dotdot/untracked"
- )
-+ sub_dir=$1 &&
-+
-+ git -C "$sub_dir" for-each-ref --format='%(refname)' 'refs/heads/*' >heads &&
-+ { git -C "$sub_dir" symbolic-ref HEAD || :; } >head &&
-+ git -C "$sub_dir" rev-parse HEAD >head-sha1 &&
-+ git -C "$sub_dir" update-index --refresh &&
-+ git -C "$sub_dir" diff-files --exit-code &&
-+ git -C "$sub_dir" clean -n -d -x >untracked
++ git -C "$dir" for-each-ref --format='%(refname)' 'refs/heads/*' >heads &&
++ { git -C "$dir" symbolic-ref HEAD || :; } >head &&
++ git -C "$dir" rev-parse HEAD >head-sha1 &&
++ git -C "$dir" update-index --refresh &&
++ git -C "$dir" diff-files --exit-code &&
++ git -C "$dir" clean -n -d -x >untracked
}
++
test_expect_success 'submodule add' '
-@@ -146,7 +138,7 @@ test_expect_success 'submodule add' '
+ echo "refs/heads/main" >expect &&
+
+@@ -146,7 +139,7 @@ test_expect_success 'submodule add' '
) &&
rm -f heads head untracked &&
@@ -54,7 +55,7 @@
test_cmp expect heads &&
test_cmp expect head &&
test_must_be_empty untracked
-@@ -248,7 +240,7 @@ test_expect_success 'submodule add --branch' '
+@@ -237,7 +230,7 @@ test_expect_success 'submodule add --branch' '
) &&
rm -f heads head untracked &&
@@ -63,7 +64,7 @@
test_cmp expect-heads heads &&
test_cmp expect-head head &&
test_must_be_empty untracked
-@@ -264,7 +256,7 @@ test_expect_success 'submodule add with ./ in path' '
+@@ -253,7 +246,7 @@ test_expect_success 'submodule add with ./ in path' '
) &&
rm -f heads head untracked &&
@@ -72,7 +73,7 @@
test_cmp expect heads &&
test_cmp expect head &&
test_must_be_empty untracked
-@@ -280,7 +272,7 @@ test_expect_success 'submodule add with /././ in path' '
+@@ -269,7 +262,7 @@ test_expect_success 'submodule add with /././ in path' '
) &&
rm -f heads head untracked &&
@@ -81,7 +82,7 @@
test_cmp expect heads &&
test_cmp expect head &&
test_must_be_empty untracked
-@@ -296,7 +288,7 @@ test_expect_success 'submodule add with // in path' '
+@@ -285,7 +278,7 @@ test_expect_success 'submodule add with // in path' '
) &&
rm -f heads head untracked &&
@@ -90,7 +91,7 @@
test_cmp expect heads &&
test_cmp expect head &&
test_must_be_empty untracked
-@@ -312,7 +304,7 @@ test_expect_success 'submodule add with /.. in path' '
+@@ -301,7 +294,7 @@ test_expect_success 'submodule add with /.. in path' '
) &&
rm -f heads head untracked &&
@@ -99,7 +100,7 @@
test_cmp expect heads &&
test_cmp expect head &&
test_must_be_empty untracked
-@@ -328,7 +320,7 @@ test_expect_success 'submodule add with ./, /.. and // in path' '
+@@ -317,7 +310,7 @@ test_expect_success 'submodule add with ./, /.. and // in path' '
) &&
rm -f heads head untracked &&
@@ -108,7 +109,7 @@
test_cmp expect heads &&
test_cmp expect head &&
test_must_be_empty untracked
-@@ -359,7 +351,7 @@ test_expect_success 'submodule add in subdirectory' '
+@@ -348,7 +341,7 @@ test_expect_success 'submodule add in subdirectory' '
) &&
rm -f heads head untracked &&
@@ -118,5 +119,5 @@
test_cmp expect head &&
test_must_be_empty untracked
--
-2.33.0.1079.g6e70778dc9-goog
+2.32.0.272.g935e593368-goog