You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
describe('log-commit-order',()=>{it('commits and logs in chronological order',async()=>{constcontext=awaitcreateTestContext();awaitsetUpInit(context);constgit=newSimpleGit(context.root);consthashes: string[]=[];awaitsetUpFilesAdded(context,['first'],'.',' commit 1');hashes.push(awaitgit.revparse('HEAD'));awaitgit.checkout(['-b','new_branch']);awaitsetUpFilesAdded(context,['second'],'.',' commit 2');hashes.push(awaitgit.revparse('HEAD'));awaitgit.addTag('new_tag');awaitgit.checkout('master');consttagHashes=(awaitgit.log(['new_tag'])).all.map(({hash})=>hash);expect(hashes).toEqual(tagHashes.reverse());});})
And found that I always had master with a single commit, new_branch and new_tag have the same two commits that appear in git.log in reverse chronological order.
Is it possible that some other process is accessing this.git while your script is running?
Activity
steveukx commentedon Apr 2, 2022
Hi, I wrote an integration test to cover this:
And found that I always had
masterwith a single commit,new_branchandnew_taghave the same two commits that appear ingit.login reverse chronological order.Is it possible that some other process is accessing
this.gitwhile your script is running?ffleandro commentedon Apr 4, 2022
I'm using this code inside of a NodeJS/ExpressJS API running in dev mode, so there is the chance that there are more than one process spinned up.
I mean, all the commits and branching/tagging are done by a single API call, is there a way to make this work as expected?