Skip to content

Commit 6796399

Browse files
committed
Merge branch 'maint'
* maint: GIT 1.5.6.4 builtin-rm: fix index lock file path http-fetch: do not SEGV after fetching a bad pack idx file rev-list: honor --quiet option api-run-command.txt: typofix
2 parents 03db452 + a1b6fb0 commit 6796399

File tree

6 files changed

+31
-16
lines changed

6 files changed

+31
-16
lines changed

Documentation/RelNotes-1.5.6.4.txt

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,20 @@ Fixes since v1.5.6.3
2828
be huge by saying "no common commits", but this was an unnecessary
2929
noise; it is already known by the user anyway.
3030

31+
* "git-http-fetch" would have segfaulted when pack idx file retrieved
32+
from the other side was corrupt.
33+
34+
* "git-index-pack" used too much memory when dealing with a deep delta chain.
35+
3136
* "git-mailinfo" (hence "git-am") did not correctly handle in-body [PATCH]
3237
line to override the commit title taken from the mail Subject header.
3338

3439
* "git-rebase -i -p" lost parents that are not involved in the history
3540
being rewritten.
3641

37-
Contains other various documentation fixes.
42+
* "git-rm" lost track of where the index file was when GIT_DIR was
43+
specified as a relative path.
3844

39-
--
40-
exec >/var/tmp/1
41-
echo O=$(git describe maint)
42-
O=v1.5.6.3-21-gebcce31
43-
git shortlog --no-merges $O..maint
45+
* "git-rev-list --quiet" was not quiet as advertised.
46+
47+
Contains other various documentation fixes.

Documentation/technical/api-run-command.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Functions
3030
start_command() followed by finish_command(). Takes a pointer
3131
to a `struct child_process` that specifies the details.
3232

33-
`run_command_v_opt`, `run_command_v_opt_dir`, `run_command_v_opt_cd_env`::
33+
`run_command_v_opt`, `run_command_v_opt_cd`, `run_command_v_opt_cd_env`::
3434

3535
Convenience functions that encapsulate a sequence of
3636
start_command() followed by finish_command(). The argument argv

builtin-rev-list.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,7 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)
590590
revs.commit_format = CMIT_FMT_UNSPECIFIED;
591591
argc = setup_revisions(argc, argv, &revs, NULL);
592592

593+
quiet = DIFF_OPT_TST(&revs.diffopt, QUIET);
593594
for (i = 1 ; i < argc; i++) {
594595
const char *arg = argv[i];
595596

@@ -621,10 +622,6 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)
621622
read_revisions_from_stdin(&revs);
622623
continue;
623624
}
624-
if (!strcmp(arg, "--quiet")) {
625-
quiet = 1;
626-
continue;
627-
}
628625
usage(rev_list_usage);
629626

630627
}

builtin-rm.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -146,18 +146,18 @@ int cmd_rm(int argc, const char **argv, const char *prefix)
146146

147147
git_config(git_default_config, NULL);
148148

149-
newfd = hold_locked_index(&lock_file, 1);
150-
151-
if (read_cache() < 0)
152-
die("index file corrupt");
153-
154149
argc = parse_options(argc, argv, builtin_rm_options, builtin_rm_usage, 0);
155150
if (!argc)
156151
usage_with_options(builtin_rm_usage, builtin_rm_options);
157152

158153
if (!index_only)
159154
setup_work_tree();
160155

156+
newfd = hold_locked_index(&lock_file, 1);
157+
158+
if (read_cache() < 0)
159+
die("index file corrupt");
160+
161161
pathspec = get_pathspec(prefix, argv);
162162
seen = NULL;
163163
for (i = 0; pathspec[i] ; i++)

http-walker.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,8 @@ static int setup_index(struct walker *walker, struct alt_base *repo, unsigned ch
442442
return -1;
443443

444444
new_pack = parse_pack_index(sha1);
445+
if (!new_pack)
446+
return -1; /* parse_pack_index() already issued error message */
445447
new_pack->next = repo->packs;
446448
repo->packs = new_pack;
447449
return 0;

t/t3600-rm.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,4 +217,16 @@ test_expect_success 'Remove nonexistent file returns nonzero exit status' '
217217
test_must_fail git rm nonexistent
218218
'
219219

220+
test_expect_success 'Call "rm" from outside the work tree' '
221+
mkdir repo &&
222+
cd repo &&
223+
git init &&
224+
echo something > somefile &&
225+
git add somefile &&
226+
git commit -m "add a file" &&
227+
(cd .. &&
228+
git --git-dir=repo/.git --work-tree=repo rm somefile) &&
229+
test_must_fail git ls-files --error-unmatch somefile
230+
'
231+
220232
test_done

0 commit comments

Comments
 (0)