Skip to content

Commit 4f11a32

Browse files
committed
Store submodule commits bounded for HEAD of top repository
1 parent fc86194 commit 4f11a32

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

git-archive-all.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,9 +249,9 @@ fi
249249
if [ $VERBOSE -eq 1 ]; then
250250
echo -n "archiving submodules..."
251251
fi
252-
git submodule >>"$TMPLIST"
252+
git submodule status --recursive --cached >> "$TMPLIST"
253253
while read path; do
254-
TREEISH=$(grep "^ .*${path%/} " "$TMPLIST" | cut -d ' ' -f 2) # git submodule does not list trailing slashes in $path
254+
TREEISH=$(sed -nr -e 's@^[ +-]@@' -e 's@ +\(.*\)$@@' -e 's@([^ ]+) +'"${path%/}"'$@\1@ p' "$TMPLIST") # git submodule does not list trailing slashes in $path
255255
cd "$path"
256256
rm -f "$TMPDIR"/"$(echo "$path" | sed -e 's/\//./g')"$FORMAT
257257
git archive --format=$FORMAT --prefix="${PREFIX}$path" $ARCHIVE_OPTS ${TREEISH:-HEAD} > "$TMPDIR"/"$(echo "$path" | sed -e 's/\//./g')"$FORMAT

0 commit comments

Comments
 (0)