Skip to content

Commit f44d5d0

Browse files
committed
Store exact submodule commit for --treeish
1 parent fc86194 commit f44d5d0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

git-archive-all.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ fi
249249
if [ $VERBOSE -eq 1 ]; then
250250
echo -n "archiving submodules..."
251251
fi
252-
git submodule >>"$TMPLIST"
252+
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"
253253
while read path; do
254254
TREEISH=$(grep "^ .*${path%/} " "$TMPLIST" | cut -d ' ' -f 2) # git submodule does not list trailing slashes in $path
255255
cd "$path"

0 commit comments

Comments
 (0)