jenkinsci / jenkinsci/git-plugin

[JENKINS-29038] recursively update submodules does not recursively sync first

Open
#2,675 3 comments 0 reactions 0 assignees View on GitHub
component:git-plugin imported-jira-issue priority:major resolution:unresolved
Dominant language
Java
Stars
694
Forks
1.1k
Avg merge
1h 29m
Merged PRs (30d)
3

Description

When using feature "additional behaviors->advanced submodules behaviors->Recursively update submodules", the update may fail due to the submodules not being sync'd recursively first.

Checking out Revision e4bfb606a6e031ea2ba43d1111b890bf4db3d435 (refs/remotes/origin/branchwithnestedsubmodulechange)

> /usr/local/git/bin/git config core.sparsecheckout # timeout=10

> /usr/local/git/bin/git checkout -f e4bfb606a6e031ea2ba43d1111b890bf4db3d435

> /usr/local/git/bin/git rev-list e4bfb606a6e031ea2ba43d1111b890bf4db3d435 # timeout=10

> /usr/local/git/bin/git remote # timeout=10

> /usr/local/git/bin/git submodule init # timeout=10

> /usr/local/git/bin/git submodule sync # timeout=10

> /usr/local/git/bin/git config --get remote.origin.url # timeout=10

> /usr/local/git/bin/git submodule update --init --recursive

FATAL: Command "/usr/local/git/bin/git submodule update --init --recursive" returned status code 1:

stdout:

stderr: fatal: reference is not a tree: 11162a5ae76bf4b798afe5fb3f4a13df74165574

Unable to checkout '11162a5ae76bf4b798afe5fb3f4a13df74165574' in submodule path 'submodules/socket.IO-objc/submodules/socket-rocket'

Failed to recurse into submodule path 'submodules/socket.IO-objc'

The console log above shows that "git submodule update" includes the "--recursive" argument, but "git submodule init" and "git submodule sync" do not.

In my particular scenario, I need "git submodule sync --recursive" before the recursive submodule update will succeed.

---
Originally reported by badcorporatelogo, imported from: recursively update submodules does not recursively sync first


  • status: Open
  • priority: Major
  • component(s): git-plugin
  • resolution: Unresolved
  • votes: 5
  • watchers: 5
  • imported: 2025-12-02

Raw content of original issue

When using feature "additional behaviors->advanced submodules behaviors->Recursively update submodules", the update may fail due to the submodules not being sync'd recursively first.

Checking out Revision e4bfb606a6e031ea2ba43d1111b890bf4db3d435 (refs/remotes/origin/branchwithnestedsubmodulechange)
> /usr/local/git/bin/git config core.sparsecheckout # timeout=10
> /usr/local/git/bin/git checkout -f e4bfb606a6e031ea2ba43d1111b890bf4db3d435
> /usr/local/git/bin/git rev-list e4bfb606a6e031ea2ba43d1111b890bf4db3d435 # timeout=10
> /usr/local/git/bin/git remote # timeout=10
> /usr/local/git/bin/git submodule init # timeout=10
> /usr/local/git/bin/git submodule sync # timeout=10
> /usr/local/git/bin/git config --get remote.origin.url # timeout=10
> /usr/local/git/bin/git submodule update --init --recursive
FATAL: Command "/usr/local/git/bin/git submodule update --init --recursive" returned status code 1:
stdout:
stderr: fatal: reference is not a tree: 11162a5ae76bf4b798afe5fb3f4a13df74165574
Unable to checkout '11162a5ae76bf4b798afe5fb3f4a13df74165574' in submodule path 'submodules/socket.IO-objc/submodules/socket-rocket'
Failed to recurse into submodule path 'submodules/socket.IO-objc'

The console log above shows that "git submodule update" includes the "--recursive" argument, but "git submodule init" and "git submodule sync" do not.

In my particular scenario, I need "git submodule sync --recursive" before the recursive submodule update will succeed.

environment

```
Jenkins 1.607

git-plugin 2.3

slave running OSX
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.