Skip to content

Commit

Permalink
Merge branch 'maint'
Browse files Browse the repository at this point in the history
* maint:
  Makefile: fix shell quoting
  tests: propagate $(TAR) down from the toplevel Makefile
  index-pack.c: correctly initialize appended objects
  send-email: find body-encoding correctly
  • Loading branch information
Junio C Hamano committed Jul 25, 2008
2 parents c921cc9 + bfce508 commit d9d9e6e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1255,8 +1255,12 @@ GIT-CFLAGS: .FORCE-GIT-CFLAGS
echo "$$FLAGS" >GIT-CFLAGS; \
fi

# We need to apply sq twice, once to protect from the shell
# that runs GIT-BUILD-OPTIONS, and then again to protect it
# and the first level quoting from the shell that runs "echo".
GIT-BUILD-OPTIONS: .FORCE-GIT-BUILD-OPTIONS
@echo SHELL_PATH=\''$(SHELL_PATH_SQ)'\' >$@
@echo SHELL_PATH=\''$(subst ','\'',$(SHELL_PATH_SQ))'\' >$@
@echo TAR=\''$(subst ','\'',$(subst ','\'',$(TAR)))'\' >>$@

### Detect Tck/Tk interpreter path changes
ifndef NO_TCLTK
Expand Down
2 changes: 1 addition & 1 deletion git-send-email.perl
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,7 @@ sub send_message
}
elsif (/^Content-type:/i) {
$has_content_type = 1;
if (/charset="?[^ "]+/) {
if (/charset="?([^ "]+)/) {
$body_encoding = $1;
}
push @xh, $_;
Expand Down
4 changes: 4 additions & 0 deletions index-pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -699,6 +699,10 @@ static struct object_entry *append_obj_to_pack(
write_or_die(output_fd, header, n);
obj[0].idx.crc32 = crc32(0, Z_NULL, 0);
obj[0].idx.crc32 = crc32(obj[0].idx.crc32, header, n);
obj[0].size = size;
obj[0].hdr_size = n;
obj[0].type = type;
obj[0].real_type = type;
obj[1].idx.offset = obj[0].idx.offset + n;
obj[1].idx.offset += write_compressed(output_fd, buf, size, &obj[0].idx.crc32);
hashcpy(obj->idx.sha1, sha1);
Expand Down
11 changes: 5 additions & 6 deletions t/t5000-tar-tree.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ commit id embedding:
'

. ./test-lib.sh
TAR=${TAR:-tar}
UNZIP=${UNZIP:-unzip}

SUBSTFORMAT=%H%n
Expand Down Expand Up @@ -77,7 +76,7 @@ test_expect_success \
test_expect_success \
'validate file modification time' \
'mkdir extract &&
$TAR xf b.tar -C extract a/a &&
"$TAR" xf b.tar -C extract a/a &&
perl -e '\''print((stat("extract/a/a"))[9], "\n")'\'' >b.mtime &&
echo "1117231200" >expected.mtime &&
diff expected.mtime b.mtime'
Expand All @@ -89,7 +88,7 @@ test_expect_success \

test_expect_success \
'extract tar archive' \
'(cd b && $TAR xf -) <b.tar'
'(cd b && "$TAR" xf -) <b.tar'

test_expect_success \
'validate filenames' \
Expand All @@ -106,7 +105,7 @@ test_expect_success \

test_expect_success \
'extract tar archive with prefix' \
'(cd c && $TAR xf -) <c.tar'
'(cd c && "$TAR" xf -) <c.tar'

test_expect_success \
'validate filenames with prefix' \
Expand All @@ -126,7 +125,7 @@ test_expect_success \

test_expect_success \
'extract substfiles' \
'(mkdir f && cd f && $TAR xf -) <f.tar'
'(mkdir f && cd f && "$TAR" xf -) <f.tar'

test_expect_success \
'validate substfile contents' \
Expand All @@ -138,7 +137,7 @@ test_expect_success \

test_expect_success \
'extract substfiles from archive with prefix' \
'(mkdir g && cd g && $TAR xf -) <g.tar'
'(mkdir g && cd g && "$TAR" xf -) <g.tar'

test_expect_success \
'validate substfile contents from archive with prefix' \
Expand Down

0 comments on commit d9d9e6e

Please sign in to comment.