Skip to content

Commit

Permalink
Support other tar format configured by git tar.FORMAT.command setting
Browse files Browse the repository at this point in the history
  • Loading branch information
KSR-Yasuda committed Feb 6, 2024
1 parent fc86194 commit 1a1e3a5
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion git-archive-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,17 @@ if [ $VERBOSE -eq 1 ]; then
fi
# Concatenate archives into a super-archive.
if [ $SEPARATE -eq 0 -o "-" == "$OUT_FILE" ]; then
if [ $FORMAT == 'tar.gz' ]; then
cmd=$(git config --get "tar.$FORMAT.command")
if [ -n "$cmd" -a "$FORMAT" != "tar" ]; then
superfile_=${superfile%.$FORMAT}.tar
$cmd -d < "$superfile" > "$superfile_" && rm -f "$superfile"
sed -e '1d' $TMPFILE | while read file; do
file_=${file%.$FORMAT}.tar
$cmd -d < "$file" > "$file_" && rm -f "$file"
$TARCMD --concatenate -f "$superfile_" "$file_" && rm -f "$file_"
done
$cmd < "$superfile_" > "$superfile" && rm -f "$superfile_"
elif [ $FORMAT == 'tar.gz' ]; then
gunzip $superfile
superfile=${superfile:0: -3} # Remove '.gz'
sed -e '1d' $TMPFILE | while read file; do
Expand Down

0 comments on commit 1a1e3a5

Please sign in to comment.