Skip to content

Commit f188b30

Browse files
stefanbellergitster
authored andcommitted
git-submodule.sh: rename unused variables
The 'mode' variable is not used in cmd_update for its original purpose, rename it to 'dummy' as it only serves the purpose to abort quickly documenting this knowledge. The variable 'stage' is also not used any more in cmd_update, so remove it. This went unnoticed as first each function used the commonly used submodule listing, which was converted in 74703a1 (submodule: rewrite `module_list` shell function in C, 2015-09-02). When cmd_update was using its own function starting in 4830868 (git submodule update: have a dedicated helper for cloning, 2016-02-29), its removal was missed. A later patch in this series also touches the communication between the submodule helper and git-submodule.sh, but let's have this as a preparatory patch, as it eases the next patch, which stores the raw data instead of the line printed for this communication. Signed-off-by: Stefan Beller <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c1cb423 commit f188b30

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

builtin/submodule--helper.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1571,9 +1571,8 @@ static int prepare_to_clone_next_submodule(const struct cache_entry *ce,
15711571
needs_cloning = !file_exists(sb.buf);
15721572

15731573
strbuf_reset(&sb);
1574-
strbuf_addf(&sb, "%06o %s %d %d\t%s\n", ce->ce_mode,
1575-
oid_to_hex(&ce->oid), ce_stage(ce),
1576-
needs_cloning, ce->name);
1574+
strbuf_addf(&sb, "dummy %s %d\t%s\n",
1575+
oid_to_hex(&ce->oid), needs_cloning, ce->name);
15771576
string_list_append(&suc->projectlines, sb.buf);
15781577

15791578
if (!needs_cloning)

git-submodule.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -531,9 +531,9 @@ cmd_update()
531531
"$@" || echo "#unmatched" $?
532532
} | {
533533
err=
534-
while read -r mode sha1 stage just_cloned sm_path
534+
while read -r quickabort sha1 just_cloned sm_path
535535
do
536-
die_if_unmatched "$mode" "$sha1"
536+
die_if_unmatched "$quickabort" "$sha1"
537537

538538
name=$(git submodule--helper name "$sm_path") || exit
539539
if ! test -z "$update"

0 commit comments

Comments
 (0)