After a few changes in JGIT(BasePackFetchConnection class) we were able to send command (deepen 2) to the server for shallow clone. However when the server responds with a shallow commit Jgit is not able to handle this.
What further commands have to be sent to the server to receive the shallow repository in a pack ? The below document is not clear regarding how to handle a shallow response https://github.com/git/git/blob/master/Documentation/technical/pack-protocol.txt