Skip to content

Commit dc05d73

Browse files
committed
Merge branch 'maint'
* maint: Git 1.7.0.1 Remove reference to GREP_COLORS from documentation sha1_name: fix segfault caused by invalid index access
2 parents d32fad2 + c5e5f60 commit dc05d73

File tree

5 files changed

+31
-24
lines changed

5 files changed

+31
-24
lines changed

Documentation/RelNotes-1.7.0.1.txt

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,17 @@ Fixes since v1.7.0
77
* In a freshly created repository "rev-parse HEAD^0" complained that
88
it is dangling symref, even though "rev-parse HEAD" didn't.
99

10+
* "git show :no-such-name" tried to access the index without bounds
11+
check, leading to a potential segfault.
12+
1013
* Message from "git cherry-pick" was harder to read and use than necessary
1114
when it stopped due to conflicting changes.
1215

16+
* We referred to ".git/refs/" throughout the documentation when we
17+
meant to talk about abstract notion of "ref namespace". Because
18+
people's repositories often have packed refs these days, this was
19+
confusing.
20+
1321
* "git diff --output=/path/that/cannot/be/written" did not correctly
1422
error out.
1523

@@ -24,8 +32,4 @@ Fixes since v1.7.0
2432
option was propagated to "git stash drop" that is internally run at the
2533
end.
2634

27-
--
28-
exec >/var/tmp/1
29-
echo O=$(git describe)
30-
O=v1.7.0-22-gc69f921
31-
git shortlog $O..
35+
And other minor fixes and documentation updates.

Documentation/config.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -685,9 +685,7 @@ color.grep::
685685

686686
color.grep.match::
687687
Use customized color for matches. The value of this variable
688-
may be specified as in color.branch.<slot>. It is passed using
689-
the environment variables 'GREP_COLOR' and 'GREP_COLORS' when
690-
calling an external 'grep'.
688+
may be specified as in color.branch.<slot>.
691689

692690
color.interactive::
693691
When set to `always`, always use colors for interactive prompts

Documentation/git.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,10 @@ unreleased) version of git, that is available from 'master'
4343
branch of the `git.git` repository.
4444
Documentation for older releases are available here:
4545

46-
* link:v1.7.0/git.html[documentation for release 1.7.0]
46+
* link:v1.7.0.1/git.html[documentation for release 1.7.0.1]
4747

4848
* release notes for
49+
link:RelNotes-1.7.0.1.txt[1.7.0.1],
4950
link:RelNotes-1.7.0.txt[1.7.0].
5051

5152
* link:v1.6.6.2/git.html[documentation for release 1.6.6.2]

GIT-VERSION-GEN

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/sh
22

33
GVF=GIT-VERSION-FILE
4-
DEF_VER=v1.7.0.GIT
4+
DEF_VER=v1.7.0.1
55

66
LF='
77
'

sha1_name.c

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -992,13 +992,15 @@ static void diagnose_invalid_index_path(int stage,
992992
pos = cache_name_pos(filename, namelen);
993993
if (pos < 0)
994994
pos = -pos - 1;
995-
ce = active_cache[pos];
996-
if (ce_namelen(ce) == namelen &&
997-
!memcmp(ce->name, filename, namelen))
998-
die("Path '%s' is in the index, but not at stage %d.\n"
999-
"Did you mean ':%d:%s'?",
1000-
filename, stage,
1001-
ce_stage(ce), filename);
995+
if (pos < active_nr) {
996+
ce = active_cache[pos];
997+
if (ce_namelen(ce) == namelen &&
998+
!memcmp(ce->name, filename, namelen))
999+
die("Path '%s' is in the index, but not at stage %d.\n"
1000+
"Did you mean ':%d:%s'?",
1001+
filename, stage,
1002+
ce_stage(ce), filename);
1003+
}
10021004

10031005
/* Confusion between relative and absolute filenames? */
10041006
fullnamelen = namelen + strlen(prefix);
@@ -1008,13 +1010,15 @@ static void diagnose_invalid_index_path(int stage,
10081010
pos = cache_name_pos(fullname, fullnamelen);
10091011
if (pos < 0)
10101012
pos = -pos - 1;
1011-
ce = active_cache[pos];
1012-
if (ce_namelen(ce) == fullnamelen &&
1013-
!memcmp(ce->name, fullname, fullnamelen))
1014-
die("Path '%s' is in the index, but not '%s'.\n"
1015-
"Did you mean ':%d:%s'?",
1016-
fullname, filename,
1017-
ce_stage(ce), fullname);
1013+
if (pos < active_nr) {
1014+
ce = active_cache[pos];
1015+
if (ce_namelen(ce) == fullnamelen &&
1016+
!memcmp(ce->name, fullname, fullnamelen))
1017+
die("Path '%s' is in the index, but not '%s'.\n"
1018+
"Did you mean ':%d:%s'?",
1019+
fullname, filename,
1020+
ce_stage(ce), fullname);
1021+
}
10181022

10191023
if (!lstat(filename, &st))
10201024
die("Path '%s' exists on disk, but not in the index.", filename);

0 commit comments

Comments
 (0)