stefanwille / git-branch-delete

Interactive command line tool that makes it comfortable to delete several Git branches at once.
72 stars 9 forks source link

'error: branch ''XXX'' not found' on Windows #14

Open fohrloop opened 5 months ago

fohrloop commented 5 months ago

Does this tool support Windows? I'm getting:

(venv) PS C:\cases\wakepy> git-branch-delete    
√ Which branches do you want to delete? · dev, dev-docs-update, fix-readme, issue-337-inv-test-failing-coverage, issue-340-cove-coverage-not-shown-in-browser-win, issue60-windows-methods, make-tests-work-on-windows, update-dev-docs

You have selected these branches to delete:
 1. dev
 2. dev-docs-update
 3. fix-readme
 4. issue-337-inv-test-failing-coverage
 5. issue-340-cove-coverage-not-shown-in-browser-win
 6. issue60-windows-methods
 7. make-tests-work-on-windows
 8. update-dev-docs
√ Delete these 8 branches? Type yes or no · yes
git branch -D 'dev'
error: branch ''dev'' not found.
node:child_process:828
    err = new Error(msg);
          ^

Error: Command failed: git branch -D 'dev'
error: branch ''dev'' not found.

    at checkExecSyncError (node:child_process:828:11)
    at Object.execSync (node:child_process:902:15)
    at deleteBranches (C:\Users\niko\AppData\Roaming\npm\node_modules\git-branch-delete\build\git-branch-delete.js:125:36)
    at C:\Users\niko\AppData\Roaming\npm\node_modules\git-branch-delete\build\git-branch-delete.js:157:17
    at step (C:\Users\niko\AppData\Roaming\npm\node_modules\git-branch-delete\build\git-branch-delete.js:34:23)
    at Object.next (C:\Users\niko\AppData\Roaming\npm\node_modules\git-branch-delete\build\git-branch-delete.js:15:53)
    at fulfilled (C:\Users\niko\AppData\Roaming\npm\node_modules\git-branch-delete\build\git-branch-delete.js:6:58)
    at processTicksAndRejections (node:internal/process/task_queues:96:5) {
  status: 1,
  signal: null,
  output: [ null, '', "error: branch ''dev'' not found.\n" ],
  pid: 8712,
  stdout: '',
  stderr: "error: branch ''dev'' not found.\n"
}

using a version of git-branch-delete installed today 2024-06-02 (did not find an easy way to check the version). Git branch -a says:

(venv) PS C:\cases\wakepy> git branch -a
warning: ignoring broken ref refs/remotes/origin/HEAD
  dev
  dev-docs-update
  fix-readme
* issue-167-windows-multiple-modes-same-thread
  issue-337-inv-test-failing-coverage
  issue-340-cove-coverage-not-shown-in-browser-win
  issue60-windows-methods
  main
  make-tests-work-on-windows
  update-dev-docs
  remotes/origin/main
stefanwille commented 5 months ago

Hello @fohrloop I have never tested on Windows. Could be that it doesn't work there.

fohrloop commented 5 months ago

Just tested if it's just the extra ' which makes difference. On command line this did work though:

PS C:\cases\wakepy> git branch -D 'dev'
Deleted branch dev (was 9646615).