Skip to content

Commit f0b0d78

Browse files
committed
Merge branch 'maint-1.6.5' into maint
* maint-1.6.5: Git 1.6.5.8 Fix mis-backport of t7002 bash completion: factor submodules into dirty state reset: unbreak hard resets with GIT_WORK_TREE Conflicts: Documentation/git.txt GIT-VERSION-GEN RelNotes
2 parents 6329bad + 35eabd1 commit f0b0d78

File tree

5 files changed

+40
-9
lines changed

5 files changed

+40
-9
lines changed

Documentation/RelNotes-1.6.5.8.txt

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
Git v1.6.5.8 Release Notes
2+
==========================
3+
4+
Fixes since v1.6.5.7
5+
--------------------
6+
7+
* "git count-objects" did not handle packfiles that are bigger than 4G on
8+
platforms with 32-bit off_t.
9+
10+
* "git rebase -i" did not abort cleanly if it failed to launch the editor.
11+
12+
* "git blame" did not work well when commit lacked the author name.
13+
14+
* "git fast-import" choked when handling a tag that points at an object
15+
that is not a commit.
16+
17+
* "git reset --hard" did not work correctly when GIT_WORK_TREE environment
18+
variable is used to point at the root of the true work tree.
19+
20+
* "git grep" fed a buffer that is not NUL-terminated to underlying
21+
regexec().
22+
23+
* "git checkout -m other" while on a branch that does not have any commit
24+
segfaulted, instead of failing.
25+
26+
* "git branch -a other" should have diagnosed the command as an error.
27+
28+
Other minor documentation updates are also included.

Documentation/git.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,10 @@ Documentation for older releases are available here:
4848
* release notes for
4949
link:RelNotes-1.6.6.txt[1.6.6].
5050

51-
* link:v1.6.5.7/git.html[documentation for release 1.6.5.7]
51+
* link:v1.6.5.8/git.html[documentation for release 1.6.5.8]
5252

5353
* release notes for
54+
link:RelNotes-1.6.5.8.txt[1.6.5.8],
5455
link:RelNotes-1.6.5.7.txt[1.6.5.7],
5556
link:RelNotes-1.6.5.6.txt[1.6.5.6],
5657
link:RelNotes-1.6.5.5.txt[1.6.5.5],

builtin-reset.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -286,10 +286,8 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
286286
if (reset_type == NONE)
287287
reset_type = MIXED; /* by default */
288288

289-
if ((reset_type == HARD || reset_type == MERGE)
290-
&& !is_inside_work_tree())
291-
die("%s reset requires a work tree",
292-
reset_type_names[reset_type]);
289+
if (reset_type == HARD || reset_type == MERGE)
290+
setup_work_tree();
293291

294292
/* Soft reset does not touch the index file nor the working tree
295293
* at all, but requires them in a good order. Other resets reset

contrib/completion/git-completion.bash

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,9 @@ __git_ps1 ()
142142
elif [ "true" = "$(git rev-parse --is-inside-work-tree 2>/dev/null)" ]; then
143143
if [ -n "${GIT_PS1_SHOWDIRTYSTATE-}" ]; then
144144
if [ "$(git config --bool bash.showDirtyState)" != "false" ]; then
145-
git diff --no-ext-diff --ignore-submodules \
146-
--quiet --exit-code || w="*"
145+
git diff --no-ext-diff --quiet --exit-code || w="*"
147146
if git rev-parse --quiet --verify HEAD >/dev/null; then
148-
git diff-index --cached --quiet \
149-
--ignore-submodules HEAD -- || i="+"
147+
git diff-index --cached --quiet HEAD -- || i="+"
150148
else
151149
i="#"
152150
fi

t/t7103-reset-bare.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ test_expect_success 'soft reset is ok' '
2929
(cd .git && git reset --soft)
3030
'
3131

32+
test_expect_success 'hard reset works with GIT_WORK_TREE' '
33+
mkdir worktree &&
34+
GIT_WORK_TREE=$PWD/worktree GIT_DIR=$PWD/.git git reset --hard &&
35+
test_cmp file worktree/file
36+
'
37+
3238
test_expect_success 'setup bare' '
3339
git clone --bare . bare.git &&
3440
cd bare.git

0 commit comments

Comments
 (0)