Skip to content

Commit 304d058

Browse files
committed
Merge branch 'maint'
* maint: add -p: warn if only binary changes present git-archive: work in bare repos git-svn: change dashed git-config to git config
2 parents b849253 + 9fe7a64 commit 304d058

File tree

5 files changed

+31
-5
lines changed

5 files changed

+31
-5
lines changed

archive.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,5 +336,7 @@ int write_archive(int argc, const char **argv, const char *prefix,
336336
parse_treeish_arg(argv, &args, prefix);
337337
parse_pathspec_arg(argv + 1, &args);
338338

339+
git_config(git_default_config, NULL);
340+
339341
return ar->write_archive(&args);
340342
}

builtin-archive.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,6 @@ int cmd_archive(int argc, const char **argv, const char *prefix)
111111
{
112112
const char *remote = NULL;
113113

114-
git_config(git_default_config, NULL);
115-
116114
remote = extract_remote_arg(&argc, argv);
117115
if (remote)
118116
return run_remote_archiver(remote, argc, argv);

git-add--interactive.perl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -811,11 +811,16 @@ sub help_patch_cmd {
811811
}
812812

813813
sub patch_update_cmd {
814-
my @mods = grep { !($_->{BINARY}) } list_modified('file-only');
814+
my @all_mods = list_modified('file-only');
815+
my @mods = grep { !($_->{BINARY}) } @all_mods;
815816
my @them;
816817

817818
if (!@mods) {
818-
print STDERR "No changes.\n";
819+
if (@all_mods) {
820+
print STDERR "Only binary files changed.\n";
821+
} else {
822+
print STDERR "No changes.\n";
823+
}
819824
return 0;
820825
}
821826
if ($patch_mode) {

git-svn.perl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1191,7 +1191,7 @@ sub read_repo_config {
11911191
my $v = $opts->{$o};
11921192
my ($key) = ($o =~ /^([a-zA-Z\-]+)/);
11931193
$key =~ s/-//g;
1194-
my $arg = 'git-config';
1194+
my $arg = 'git config';
11951195
$arg .= ' --int' if ($o =~ /[:=]i$/);
11961196
$arg .= ' --bool' if ($o !~ /[:=][sfi]$/);
11971197
if (ref $v eq 'ARRAY') {

t/t5000-tar-tree.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ test_expect_success \
5757
git update-ref HEAD $(TZ=GMT GIT_COMMITTER_DATE="2005-05-27 22:00:00" \
5858
git commit-tree $treeid </dev/null)'
5959

60+
test_expect_success \
61+
'create bare clone' \
62+
'git clone --bare . bare.git &&
63+
cp .gitattributes bare.git/info/attributes'
64+
6065
test_expect_success \
6166
'remove ignored file' \
6267
'rm a/ignored'
@@ -73,6 +78,14 @@ test_expect_success \
7378
'git archive vs. git tar-tree' \
7479
'diff b.tar b2.tar'
7580

81+
test_expect_success \
82+
'git archive in a bare repo' \
83+
'(cd bare.git && git archive HEAD) >b3.tar'
84+
85+
test_expect_success \
86+
'git archive vs. the same in a bare repo' \
87+
'test_cmp b.tar b3.tar'
88+
7689
test_expect_success \
7790
'validate file modification time' \
7891
'mkdir extract &&
@@ -151,6 +164,14 @@ test_expect_success \
151164
'git archive --format=zip' \
152165
'git archive --format=zip HEAD >d.zip'
153166

167+
test_expect_success \
168+
'git archive --format=zip in a bare repo' \
169+
'(cd bare.git && git archive --format=zip HEAD) >d1.zip'
170+
171+
test_expect_success \
172+
'git archive --format=zip vs. the same in a bare repo' \
173+
'test_cmp d.zip d1.zip'
174+
154175
$UNZIP -v >/dev/null 2>&1
155176
if [ $? -eq 127 ]; then
156177
echo "Skipping ZIP tests, because unzip was not found"

0 commit comments

Comments
 (0)