Uploaded image for project: 'Bamboo Data Center'
  1. Bamboo Data Center
  2. BAM-25956

Git repository shallow checkout option not working in Bamboo 9.2.3 and later

      Issue Summary

      Git shallow checkouts not working from Bamboo 9.2.3 when both "Use shallow clones" and "Enable repository caching on agents" are enabled in the repository settings.

      This is reproducible on Data Center:

      Steps to Reproduce

      1. Use Bamboo 9.2.3 or later
      2. Create a repository
      3. Open the repository Advanced Options
      4. Notice "Enable repository caching on agents" will be already checked, keep it.
      5. Enable the "Use shallow clones" checkbox
      6. Save the repository settings
      7. Add the repository to a Plan and run a customised build with verbose logging
      8. Check the build logs

      Expected Results

      The build logs should report a checkout command such as:

      /usr/bin/git fetch -f -p ssh://ffd98edf-cab0-47a4-bc2d-79b23e5134bb@127.0.0.1:39071/big/bigfiles.git +refs/heads/master:refs/heads/master --update-head-ok --progress --verbose --depth 1 

      Notice the --depth 1 as an option to the git fetch command.

      Actual Results

      The checkout test is executed without --depth 1:

      /usr/bin/git fetch -f -p ssh://52957c39-a38c-4409-b399-d8140ed08029@127.0.0.1:45503/big/bigfiles.git +refs/heads/master:refs/heads/master --update-head-ok --progress --verbose 

      Workaround

      Repository caching on Agents and Shallow clones are mutually exclusive, meaning that only one property will be enabled at a time. This is by design and was implemented in BAM-22132. To enable shallow clones, disable "Enable repository caching on agents."

            [BAM-25956] Git repository shallow checkout option not working in Bamboo 9.2.3 and later

            No work has yet been logged on this issue.

              73868399605e Eduardo Alvarenga
              73868399605e Eduardo Alvarenga
              Affected customers:
              0 This affects my team
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: