Code

Merge branch 'maint'
authorJunio C Hamano <gitster@pobox.com>
Sat, 19 Jul 2008 18:28:06 +0000 (11:28 -0700)
committerJunio C Hamano <gitster@pobox.com>
Sat, 19 Jul 2008 18:28:06 +0000 (11:28 -0700)
* 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

Documentation/RelNotes-1.5.6.4.txt
Documentation/technical/api-run-command.txt
builtin-rev-list.c
builtin-rm.c
http-walker.c
t/t3600-rm.sh

index 130418864e5cca159d50681dfbfb4a79b0864610..d8968f1ecbd930463858870ee872efd8cb672bab 100644 (file)
@@ -28,16 +28,20 @@ Fixes since v1.5.6.3
    be huge by saying "no common commits", but this was an unnecessary
    noise; it is already known by the user anyway.
 
+* "git-http-fetch" would have segfaulted when pack idx file retrieved
+  from the other side was corrupt.
+
+* "git-index-pack" used too much memory when dealing with a deep delta chain.
+
 * "git-mailinfo" (hence "git-am") did not correctly handle in-body [PATCH]
   line to override the commit title taken from the mail Subject header.
 
 * "git-rebase -i -p" lost parents that are not involved in the history
   being rewritten.
 
-Contains other various documentation fixes.
+* "git-rm" lost track of where the index file was when GIT_DIR was
+  specified as a relative path.
 
---
-exec >/var/tmp/1
-echo O=$(git describe maint)
-O=v1.5.6.3-21-gebcce31
-git shortlog --no-merges $O..maint
+* "git-rev-list --quiet" was not quiet as advertised.
+
+Contains other various documentation fixes.
index 3e1342acf405adb322054a19123cd98fc12b69a9..75aa5d49234ec36857a7c8d2f3900001af5cbcde 100644 (file)
@@ -30,7 +30,7 @@ Functions
        start_command() followed by finish_command(). Takes a pointer
        to a `struct child_process` that specifies the details.
 
-`run_command_v_opt`, `run_command_v_opt_dir`, `run_command_v_opt_cd_env`::
+`run_command_v_opt`, `run_command_v_opt_cd`, `run_command_v_opt_cd_env`::
 
        Convenience functions that encapsulate a sequence of
        start_command() followed by finish_command(). The argument argv
index 8e1720c45bfa2ffc170b9880a6c90fcc3741bd46..893762c80f4910fadf2d6df414bd835cccb7faaa 100644 (file)
@@ -590,6 +590,7 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)
        revs.commit_format = CMIT_FMT_UNSPECIFIED;
        argc = setup_revisions(argc, argv, &revs, NULL);
 
+       quiet = DIFF_OPT_TST(&revs.diffopt, QUIET);
        for (i = 1 ; i < argc; i++) {
                const char *arg = argv[i];
 
@@ -621,10 +622,6 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)
                        read_revisions_from_stdin(&revs);
                        continue;
                }
-               if (!strcmp(arg, "--quiet")) {
-                       quiet = 1;
-                       continue;
-               }
                usage(rev_list_usage);
 
        }
index 56454ec8f4ed0612aa8932c4d5a3294da6a1f4cd..ee8247b08cd007f73d5dfffa560a9efe33d327b9 100644 (file)
@@ -146,11 +146,6 @@ int cmd_rm(int argc, const char **argv, const char *prefix)
 
        git_config(git_default_config, NULL);
 
-       newfd = hold_locked_index(&lock_file, 1);
-
-       if (read_cache() < 0)
-               die("index file corrupt");
-
        argc = parse_options(argc, argv, builtin_rm_options, builtin_rm_usage, 0);
        if (!argc)
                usage_with_options(builtin_rm_usage, builtin_rm_options);
@@ -158,6 +153,11 @@ int cmd_rm(int argc, const char **argv, const char *prefix)
        if (!index_only)
                setup_work_tree();
 
+       newfd = hold_locked_index(&lock_file, 1);
+
+       if (read_cache() < 0)
+               die("index file corrupt");
+
        pathspec = get_pathspec(prefix, argv);
        seen = NULL;
        for (i = 0; pathspec[i] ; i++)
index 51c18f2685aa1bdb7e4ed471d0ec5d31c6684fda..9dc6b27b457a2979a95018679a0b885e6fb62d9a 100644 (file)
@@ -442,6 +442,8 @@ static int setup_index(struct walker *walker, struct alt_base *repo, unsigned ch
                return -1;
 
        new_pack = parse_pack_index(sha1);
+       if (!new_pack)
+               return -1; /* parse_pack_index() already issued error message */
        new_pack->next = repo->packs;
        repo->packs = new_pack;
        return 0;
index 316775ecd96208c07f3211a24de2e5ec2ee409ab..79c06adf1f035cf727771974b2f9713da9d2fb8c 100755 (executable)
@@ -217,4 +217,16 @@ test_expect_success 'Remove nonexistent file returns nonzero exit status' '
        test_must_fail git rm nonexistent
 '
 
+test_expect_success 'Call "rm" from outside the work tree' '
+       mkdir repo &&
+       cd repo &&
+       git init &&
+       echo something > somefile &&
+       git add somefile &&
+       git commit -m "add a file" &&
+       (cd .. &&
+        git --git-dir=repo/.git --work-tree=repo rm somefile) &&
+       test_must_fail git ls-files --error-unmatch somefile
+'
+
 test_done