]> source.dussan.org Git - jgit.git/commit
Throw error when deepen-since excludes all commits 59/130359/4
authorJonathan Tan <jonathantanmy@google.com>
Tue, 2 Oct 2018 22:18:43 +0000 (15:18 -0700)
committerJonathan Tan <jonathantanmy@google.com>
Tue, 23 Oct 2018 18:10:07 +0000 (11:10 -0700)
commitf5fa1eaf399275e9cc4a6418ecadfa04c10060b6
treec9918505201e62dacba602add988d6b6e63f640a
parenta579a56e3ae2e5ab6b3287c4450fe6c59ebc85e7
Throw error when deepen-since excludes all commits

In C Git, when a client fetches with "git fetch --shallow-since=<date>
origin <ref>", and all commits reachable from <ref> are older than
<date>, the server dies with a message "no commits selected for shallow
requests". That is, (1) the --shallow-since filter applies to the commit
pointed to by the ref itself, and (2) there is a check that at least one
commit is not filtered out. (The pack-protocol.txt documentation does
not describe this, but the C implementation does this.)

The implementation in commit 1bb430dc21 ("UploadPack: support
deepen-since in protocol v2", 2018-09-27) does neither (1) nor (2), so
do both of these.

Change-Id: I9946327a71627626ecce34ca2d017d2add8867fc
Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/UploadPackTest.java
org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties
org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java
org.eclipse.jgit/src/org/eclipse/jgit/revwalk/DepthGenerator.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java