Skip to content

Plugin overwrites git submodule references #348

@marcelopaulon

Description

@marcelopaulon

To reproduce the problem:

  1. Create project A (maven project) which has the gitflow maven plugin and imports the git submodule Asub. Asub can contain anything, just text files for example. Project A must have a main branch and a develop branch.
  2. Open a new release branch in A using the gitflow plugin.
  3. Add a new commit to Asub (and push it).
  4. Update the reference in project A's release branch to point to the most recent commit in Asub.
  5. Close the release branch in project A.

Expected behavior: both main and develop point to the latest commit in Asub.

Actual behavior: main points to the latest commit but develop does not (gitflow plugin's "Update develop version back to pre-merge state" commit overwrote the reference back to what it was in the develop branch before closing the release branch.

This seems to happen because the plugin is not performing git submodule update after checkout, and when it commits it uses the -a option which adds all changes (including the dirty submodule reference, which points to the old commit in Asub).

So, I've opened a PR to add the option of always performing a git submodule update before the plugin commits any changes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions