question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Fail to clone projects with `sparseCheckoutDir` set and `main` as a default branch

See original GitHub issue

Describe the bug

Starting Quarkus REST API devfile from Get Started Page fails to clone the project.

It seems to be related to

sparseCheckoutDir: getting-started

and changes in the repo: now default branch is main (previously master)

Che version

  • latest
  • nightly
  • other: please specify

Steps to reproduce

  1. Start a new workspace from the Quarkus REST API devfile.
  2. The workspace starts, It is starting to clone but never finish, no error message. The quarkus project folder is empty.

Expected behavior

Should clone the project

Runtime

  • kubernetes (include output of kubectl version)
  • Openshift (include output of oc version)
  • minikube (include output of minikube version and kubectl version)
  • minishift (include output of minishift version and oc version)
  • docker-desktop + K8S (include output of docker version and kubectl version)
  • other: (please specify)

Screenshots

Selection_281

Installation method

  • chectl
    • provide a full command that was used to deploy Eclipse Che (including the output)
    • provide an output of chectl version command
  • OperatorHub
  • I don’t know

Environment

  • my computer
    • Windows
    • Linux
    • macOS
  • Cloud
    • Amazon
    • Azure
    • GCE
    • other (please specify)
  • Dev Sandbox (workspaces.openshift.com)
  • other: please specify

Eclipse Che Logs

Additional context

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
edeandreacommented, Jul 20, 2021

I’m seeing a similar issue when trying to use sparseCheckoutDir in the developer sandbox (workspaces.openshift.com). My devfile has

projects:
  - name: rhoar-getting-started
    source:
      type: git
      location: https://github.com/openshift-katacoda/rhoar-getting-started.git
      branch: solution
      sparseCheckoutDir: spring/spring-db-access

When the project gets checked out, the UI and the tooling (running git branch) shows master, yet the source code thats checked out reflects the correct branch (the solution branch in my specific case).

Screen Shot 2021-07-20 at 11 53 25 AM

I submitted this as #20157

0reactions
svorcommented, Aug 3, 2022

@l0rd fair enough Closing the issue since devfile v2 doesn’t support sparseCheckoutDir feature

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cloning fails for repos using 'main' as the default branch name
Set the default branch name to an empty string or nil . Avoid using git 's -b flag when the previous variable is...
Read more >
What determines default branch after "git clone"?
It prefers a branch named refs/heads/master : if both HEAD and master point to the same object ID, then clone will set the...
Read more >
Unable to change Default branch of a repository - GitLab.org
The default branch on one of our repos is permanently stuck on master . Attempting to change it to a different branch yields...
Read more >
Chapter 3. Developer workspaces - Red Hat Customer Portal
Creating a workspace from the default branch of a Git repository; 3.1.3. Creating a workspace from a ... a list of pre-defined commands;...
Read more >
5 steps to change GitHub default branch from master to main
Follow these easy 5 steps to change the default branch name in your repo to 'main' instead of 'master' to show support for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found