Skip to content

Commit 4b28cd9

Browse files
committed
Merge branch 'jc/maint-rev-list-culled-boundary'
* jc/maint-rev-list-culled-boundary: list-objects.c: don't add an unparsed NULL as a pending tree Conflicts: list-objects.c
2 parents 91b3c7c + 6e7d0ef commit 4b28cd9

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

list-objects.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,12 @@ void traverse_commit_list(struct rev_info *revs,
173173

174174
strbuf_init(&base, PATH_MAX);
175175
while ((commit = get_revision(revs)) != NULL) {
176-
add_pending_tree(revs, commit->tree);
176+
/*
177+
* an uninteresting boundary commit may not have its tree
178+
* parsed yet, but we are not going to show them anyway
179+
*/
180+
if (commit->tree)
181+
add_pending_tree(revs, commit->tree);
177182
show_commit(commit, data);
178183
}
179184
for (i = 0; i < revs->pending.nr; i++) {

t/t6110-rev-list-sparse.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/sh
2+
3+
test_description='operations that cull histories in unusual ways'
4+
. ./test-lib.sh
5+
6+
test_expect_success setup '
7+
test_commit A &&
8+
test_commit B &&
9+
test_commit C &&
10+
git checkout -b side HEAD^ &&
11+
test_commit D &&
12+
test_commit E &&
13+
git merge master
14+
'
15+
16+
test_expect_success 'rev-list --first-parent --boundary' '
17+
git rev-list --first-parent --boundary HEAD^..
18+
'
19+
20+
test_done

0 commit comments

Comments
 (0)