]> source.dussan.org Git - jgit.git/commit
DepthGenerator: fix multi-child boundary handling 57/132157/1
authorJonathan Tan <jonathantanmy@google.com>
Thu, 8 Nov 2018 22:46:10 +0000 (14:46 -0800)
committerJonathan Tan <jonathantanmy@google.com>
Thu, 8 Nov 2018 23:33:23 +0000 (15:33 -0800)
commitdf21eec1adb87a9000a62562f46ef3ff76cad482
tree2a2a40b189a79a3b577dc6ae109caa39b5bf56e1
parent1385f4b3dacca2b30dc4f78967e831720618c782
DepthGenerator: fix multi-child boundary handling

Suppose that a repository has the following commit graph:

 B   C
  \ /
   A

and it was cloned with --shallow-exclude=A. DepthGenerator does not mark
C as shallow, causing an invalid repository to be produced on the
client, because A is not sent. (A similar issue occurs when
--shallow-since is used to exclude A but neither B nor C.)

This happens whenever an excluded commit has more than one child that is
to be sent to the client. Fix DepthGenerator to handle this case
correctly.

While we're editing DepthWalk.Commit, fix the documentation of
DepthWalk.Commit#isBoundary.

Change-Id: I7068abf0fe0c864d1b0e56e1616dad1aa8719411
Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/UploadPackTest.java
org.eclipse.jgit/src/org/eclipse/jgit/revwalk/DepthGenerator.java
org.eclipse.jgit/src/org/eclipse/jgit/revwalk/DepthWalk.java