mmcc007/fledge

dev branch might not be listed first

Closed this issue · 3 comments

Hey, me again :-)

I just had an issue where fledge stopped with the error:

must be in dev branch and all files committed and pushed

But of course i was in the dev branch and all files were commited and pushed. What went wrong: I still had another branch in my project, so the git branch command lists:

   androidx
 * dev
   master

As you can see, the dev branch exists and is active (hence the asterisk). But your code in lib/src/commands/beta.dart has the validateRepo function which contains

    if (!(gitResult.isNotEmpty && gitResult[0].contains('dev')))

which explains why i got this error. You are expecting dev to the first line, while in my case it is the second. Unless there are other git version that do things differently, I'd suggest you iterate through the lines and see if the dev one starts with an asterisk.

Unless of course different git apps do not have the same output. My git version outputs:

  • git version 2.17.2 (Apple Git-113) => on my old mac
  • git version 2.17.1.windows.2 => on my windows dev machine

Both are using this format.

PS. And no, you don't have to rush to fix this. I just deleted the androidx branch and could continue. It was already merged so I didn't need it anymore.

Great find!
Plus easy fix... hopefully (the kind I like)!
You can try it out using:

git clone https://github.com/mmcc007/fledge.git
cd fledge
git checkout dev
pub global activate --source path .

If the fix is working for you, please close this issue... thnx for the feedback!

Ok, you're good. I created an extra branch called 'alpha'. Fledge does not continue when i'm on it. (Which is like it should be). Then I switched back to the dev branch and that works too. Thanks for fixing this!