Skip to content

Commit

Permalink
Check the status of git submodules when checking if a repository is u…
Browse files Browse the repository at this point in the history
…p-to-date
  • Loading branch information
kit-ty-kate committed Jul 31, 2024
1 parent 3b3a679 commit cab43a1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions master_changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ users)
## Sandbox

## VCS
* [BUG] Fail when a git submodule fails to update instead of ignoring the error [#6132 @kit-ty-kate - fix #6131]

## Build
* Synchronise opam-core.opam with opam-repository changes [#6043 @dra27]
Expand Down
7 changes: 6 additions & 1 deletion src/repository/opamGit.ml
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,12 @@ module VCS : OpamVCS.VCS = struct
@ List.map OpamFilename.SubPath.to_string
(OpamStd.Option.to_list subpath))
@@> function
| { OpamProcess.r_code = 0; _ } -> Done true
| { OpamProcess.r_code = 0; _ } ->
git repo_root ["submodule"; "status"; "--recursive"] @@> fun r ->
if r.r_code = 0 &&
List.for_all (fun s -> String.length s > 0 && s.[0] = ' ') r.r_stdout
then Done true
else (OpamProcess.cleanup ~force:true r; Done false)
| { OpamProcess.r_code = 1; _ } as r ->
OpamProcess.cleanup ~force:true r; Done false
| r -> OpamSystem.process_error r
Expand Down

0 comments on commit cab43a1

Please sign in to comment.