]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'jc/maint-rev-list-culled-boundary'
authorJunio C Hamano <gitster@pobox.com>
Wed, 23 Mar 2011 04:37:59 +0000 (21:37 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 23 Mar 2011 04:37:59 +0000 (21:37 -0700)
* jc/maint-rev-list-culled-boundary:
  list-objects.c: don't add an unparsed NULL as a pending tree

Conflicts:
list-objects.c

1  2 
list-objects.c
t/t6110-rev-list-sparse.sh

diff --cc list-objects.c
index 61f6cc98d917c3e4395ec397ac74df6a40eeb07f,518c6650e1827567be48976138aff621dc50eb92..838b6a732e4758265432cbc9c8e8fc81568a2b50
@@@ -169,12 -145,15 +169,17 @@@ void traverse_commit_list(struct rev_in
  {
        int i;
        struct commit *commit;
 +      struct strbuf base;
  
 +      strbuf_init(&base, PATH_MAX);
        while ((commit = get_revision(revs)) != NULL) {
-               add_pending_tree(revs, commit->tree);
+               /*
+                * an uninteresting boundary commit may not have its tree
+                * parsed yet, but we are not going to show them anyway
+                */
+               if (commit->tree)
+                       add_pending_tree(revs, commit->tree);
 -              show_commit(commit);
 +              show_commit(commit, data);
        }
        for (i = 0; i < revs->pending.nr; i++) {
                struct object_array_entry *pending = revs->pending.objects + i;
index 0000000000000000000000000000000000000000,2a267e84cdaebce5b0a1e043521c68204d16eb6c..656ac7fe9dc1074c5173bcfcf96503b65f33c2f5
mode 000000,100755..100755
--- /dev/null
@@@ -1,0 -1,27 +1,20 @@@
 -test_commit () {
 -      echo "$1" >"$1.file" &&
 -      git add "$1.file" &&
 -      test_tick &&
 -      git commit -m "$1"
 -}
 -
+ #!/bin/sh
+ test_description='operations that cull histories in unusual ways'
+ . ./test-lib.sh
+ test_expect_success setup '
+       test_commit A &&
+       test_commit B &&
+       test_commit C &&
+       git checkout -b side HEAD^ &&
+       test_commit D &&
+       test_commit E &&
+       git merge master
+ '
+ test_expect_success 'rev-list --first-parent --boundary' '
+       git rev-list --first-parent --boundary HEAD^..
+ '
+ test_done