Content-Length: 378326 | pFad | https://github.com/flutter/flutter/issues/103687

73 flutter naming project bug with git worktrees · Issue #103687 · flutter/flutter · GitHub
Skip to content

flutter naming project bug with git worktrees #103687

Open
@adnanjpg

Description

@adnanjpg

Steps to Reproduce

  1. create a simple app called bug with flutter create bug
  2. call git init to init a git repo, git add ., git commit -m 'init' and then connect this repo to any remote
  3. now delete the repo from your machine and clone it as a worktree with the command git clone --bare my_remote_url
  4. now you will have a bare repo of your project on your machine, let's pull our main branch (it could also be master depending on your git config) by using git worktree add main
  5. so now your code of your main branch exists at bug.git/main folder. now everything works just fine and your bundle id is something like com.example.bug
  6. now we're assuming some new stuff came to flutter and we want to reinit android folder for example. we can just remove the android folder rm -r android and then call flutter create .

Expected results:
what flutter should do is to get the name from pubspec.yaml because the name of the folder in this case presents the branch name and not the project name .

Actual results:
although my project name in pubspec.yaml is still bug, flutter will take it from the folder name which currently is main as we're in the main branch of the worktree (bug.git/main).

Logs

[✓] Flutter (Channel stable, 3.0.0, on macOS 12.3.1 21E258 darwin-arm, locale en-TR)
    • Flutter version 3.0.0 at /Users/adnanfahed/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision ee4e09cce0 (3 days ago), 2022-05-09 16:45:18 -0700
    • Engine revision d1b9a6938a
    • Dart version 2.17.0
    • DevTools version 2.12.2

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0-rc2)
    • Android SDK at /Users/adnanfahed/Library/Android/sdk
    • Platform android-31, build-tools 33.0.0-rc2
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.3.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763)

[✓] VS Code (version 1.67.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.40.0

[✓] Connected device (3 available)
    • sdk gphone arm64 (mobile) • emulator-5554 • android-arm64  • Android 11 (API 30) (emulator)
    • macOS (desktop)           • macos         • darwin-arm64   • macOS 12.3.1 21E258 darwin-arm
    • Chrome (web)              • chrome        • web-javascript • Google Chrome 101.0.4951.64
    ! Error: Adnan’s iPhone X is not connected. Xcode will continue when Adnan’s iPhone X is connected. (code -13)

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!

here is an example of the changes after flutter create .:
Screen Shot 2022-05-13 at 11 53 12

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projectc: new featureNothing broken; request for a new capabilityfound in release: 3.0Found to occur in 3.0has reproducible stepsThe issue has been confirmed reproducible and is ready to work onteam-toolOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.tool-still-validIssues that have been deemed still valid as part of the Flutter Tools issue cleanup initiative.triaged-toolTriaged by Flutter Tool team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions









      ApplySandwichStrip

      pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


      --- a PPN by Garber Painting Akron. With Image Size Reduction included!

      Fetched URL: https://github.com/flutter/flutter/issues/103687

      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy