FetchCommand: fix fetchSubmodules to work on a Ref to a blob
FetchCommand#fetchSubmodules assumed that FETCH_HEAD can always be parsed as a tree. This isn't true if it refers to a Ref referring to a BLOB. This is e.g. used in Gerrit for Refs like refs/sequences/changes which are used to implement sequences stored in git. Change-Id: I414f5b7d9f2184b2d7d53af1dfcd68cccb725ca4
This commit is contained in:
parent
8040936f8a
commit
7650832002
|
@ -140,6 +140,9 @@ private void fetchSubmodules(FetchResult results)
|
|||
if (fetchHead == null) {
|
||||
return;
|
||||
}
|
||||
if (revWalk.parseAny(fetchHead).getType() == Constants.OBJ_BLOB) {
|
||||
return;
|
||||
}
|
||||
walk.setTree(revWalk.parseTree(fetchHead));
|
||||
while (walk.next()) {
|
||||
try (Repository submoduleRepo = walk.getRepository()) {
|
||||
|
|
Loading…
Reference in New Issue