From f44d5d05dc72e27c66cf6780e3acc5e513bb75e3 Mon Sep 17 00:00:00 2001 From: yasuda Date: Wed, 7 Feb 2024 10:11:08 +0900 Subject: [PATCH] Store exact submodule commit for `--treeish` --- git-archive-all.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-archive-all.sh b/git-archive-all.sh index b72dc4d..c7b1656 100755 --- a/git-archive-all.sh +++ b/git-archive-all.sh @@ -249,7 +249,7 @@ fi if [ $VERBOSE -eq 1 ]; then echo -n "archiving submodules..." fi -git submodule >>"$TMPLIST" +git submodule status | awk -v 'ORS=\0' '{ print $2 }' | xargs -0 -I{} git ls-tree "$TREEISH" {} | awk '{ "git -C ''" $4 "'' name-rev --name-only ''" $3 "''" | getline ref; print " " $3 , $4 , "(" ref ")"}' >> "$TMPLIST" while read path; do TREEISH=$(grep "^ .*${path%/} " "$TMPLIST" | cut -d ' ' -f 2) # git submodule does not list trailing slashes in $path cd "$path"