Skip to content

Commit e33fd3c

Browse files
committed
Merge branch 'maint'
* maint: Update draft release notes to 1.6.6.1 grep: NUL terminate input from a file fast-import: tag may point to any object type
2 parents 4a88fb7 + 6f9752d commit e33fd3c

File tree

3 files changed

+22
-6
lines changed

3 files changed

+22
-6
lines changed

Documentation/RelNotes-1.6.6.1.txt

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,27 @@ Git v1.6.6.1 Release Notes
44
Fixes since v1.6.6
55
------------------
66

7+
* "git branch -a name" wasn't diagnosed as an error.
8+
9+
* "git fast-import" choked when fed a tag that do not point at a
10+
commit.
11+
12+
* "git grep" finding from work tree files could have fed garbage to
13+
the underlying regexec(3).
14+
15+
* "git grep -L" didn't show empty files (they should never match, and
16+
they should always appear in -L output as unmatching).
17+
718
* http-backend was not listed in the command list in the documentation.
819

20+
* Building on FreeBSD (both 7 and 8) needs OLD_ICONV set in the Makefile
21+
22+
* "git checkout -m some-branch" while on an unborn branch crashed.
23+
924
Other minor documentation updates are included.
1025

1126
--
1227
exec >/var/tmp/1
13-
O=v1.6.6-4-gd828fdb
28+
O=v1.6.6-39-g6304c40
1429
echo O=$(git describe maint)
1530
git shortlog --no-merges $O..maint

builtin-grep.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ static int grep_file(struct grep_opt *opt, const char *filename)
205205
return 0;
206206
}
207207
close(i);
208+
data[sz] = 0;
208209
if (opt->relative && opt->prefix_length)
209210
filename = quote_path_relative(filename, -1, &buf, opt->prefix);
210211
i = grep_buffer(opt, filename, data, sz);

fast-import.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2356,6 +2356,7 @@ static void parse_new_tag(void)
23562356
struct tag *t;
23572357
uintmax_t from_mark = 0;
23582358
unsigned char sha1[20];
2359+
enum object_type type;
23592360

23602361
/* Obtain the new tag name from the rest of our command */
23612362
sp = strchr(command_buf.buf, ' ') + 1;
@@ -2376,19 +2377,18 @@ static void parse_new_tag(void)
23762377
s = lookup_branch(from);
23772378
if (s) {
23782379
hashcpy(sha1, s->sha1);
2380+
type = OBJ_COMMIT;
23792381
} else if (*from == ':') {
23802382
struct object_entry *oe;
23812383
from_mark = strtoumax(from + 1, NULL, 10);
23822384
oe = find_mark(from_mark);
2383-
if (oe->type != OBJ_COMMIT)
2384-
die("Mark :%" PRIuMAX " not a commit", from_mark);
2385+
type = oe->type;
23852386
hashcpy(sha1, oe->sha1);
23862387
} else if (!get_sha1(from, sha1)) {
23872388
unsigned long size;
23882389
char *buf;
23892390

2390-
buf = read_object_with_reference(sha1,
2391-
commit_type, &size, sha1);
2391+
buf = read_sha1_file(sha1, &type, &size);
23922392
if (!buf || size < 46)
23932393
die("Not a valid commit: %s", from);
23942394
free(buf);
@@ -2413,7 +2413,7 @@ static void parse_new_tag(void)
24132413
"object %s\n"
24142414
"type %s\n"
24152415
"tag %s\n",
2416-
sha1_to_hex(sha1), commit_type, t->name);
2416+
sha1_to_hex(sha1), typename(type), t->name);
24172417
if (tagger)
24182418
strbuf_addf(&new_data,
24192419
"tagger %s\n", tagger);

0 commit comments

Comments
 (0)