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.

problem detecting git branch (simpleGit(dir).branchLocal())

See original GitHub issue

HI! there is a problem in:

simpleGit(dir).branchLocal((err,branch)=>{
  branch
});

it just detects the branch sometimes 😃

image

this does the reproduction: https://gist.github.com/Ardeshir81/7d387a4205be0f685d7a435766f266d4

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
steveukxcommented, Oct 9, 2018

Hi, thank you for the bug report.

There is currently a non-deterministic bug in the example as you run two asynchronous tasks in a single promise, resolving whenever the first has completed so it isn’t certain that both directories will have been set up before the test runs:

https://gist.github.com/Ardeshir81/7d387a4205be0f685d7a435766f266d4#file-reproduce-bug-js-L29

I can look at this later in the week, but you may find it useful to use the integration test section of this repo to set up the two repos before running the tests against them, for example https://github.com/steveukx/git-js/blob/master/test/integration/test-parallel-requests.js#L6

0reactions
steveukxcommented, Oct 25, 2018

Spawning “many” (in my testing it was anything over 6) child processes cause the exit & close events to return in the wrong order.

Please retry with version 1.105.0 which should resolve this issue. If it persists, please can you follow the pattern in test-concurrent-commands to create a failing test case.

Read more comments on GitHub >

github_iconTop Results From Across the Web

simple-git - npm
Start using simple-git in your project by running `npm i simple-git`. ... deletes a local branch - treats a failed attempt as an...
Read more >
git --git-dir not working as expected - Stack Overflow
So for example if I am in: cd /home/domain/ git status << runs perfect ie # On branch master # Your branch is...
Read more >
git-filter-branch Documentation - Git
Lets you rewrite Git revision history by rewriting the branches mentioned in the <rev-list options>, applying custom filters on each revision. Those filters...
Read more >
Git - Pull Not Working - Unfuddle Support
As the error message states: you will have to let Git know what remote branch it should use to track with the current...
Read more >
Write yourself a Git!
This article will implement and explain in great details (if something is not clear, please report it!) a very simplified version of Git...
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