Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.5.6 causes git branch --remotes to fail #612

Closed
trobrock opened this issue Jan 17, 2024 · 1 comment · Fixed by #613
Closed

1.5.6 causes git branch --remotes to fail #612

trobrock opened this issue Jan 17, 2024 · 1 comment · Fixed by #613
Labels
bug Something isn't working

Comments

@trobrock
Copy link

🔧 Summary

Since upgrading to 1.5.6 I have a failure when pushing to a new branch using git push -u origin some-branch

Lefthook version

1.5.6 dce1a0b

Steps to reproduce

pre-push:
  parallel: true
  commands:
    rspec:
      run: bundle exec rspec
git push -u origin some-branch

Expected results

Runs the command.

Actual results

% gp -u origin auto-save-checklist
│ [lefthook] cmd: [git rev-parse --show-toplevel]
│ [lefthook] dir: 
│ [lefthook] err: <nil>
│ [lefthook] out: /Users/trobrock/Sites/comfortly/inn_management
                                                              
│ [lefthook] cmd: [git rev-parse --git-path hooks]
│ [lefthook] dir: 
│ [lefthook] err: <nil>
│ [lefthook] out: .git/hooks
                          
│ [lefthook] cmd: [git rev-parse --git-path info]
│ [lefthook] dir: 
│ [lefthook] err: <nil>
│ [lefthook] out: .git/info
                         
│ [lefthook] cmd: [git rev-parse --git-dir]
│ [lefthook] dir: 
│ [lefthook] err: <nil>
│ [lefthook] out: .git
                    
╭────────────────────────────────────╮
│ 🥊 lefthook v1.5.6  hook: pre-push │
╰────────────────────────────────────╯
│ [lefthook] cmd: [git diff --name-only HEAD @{push}]
│ [lefthook] dir: /Users/trobrock/Sites/comfortly/inn_management
│ [lefthook] err: exit status 128
│ [lefthook] out: fatal: ambiguous argument '@{push}': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:                                                 
'git <command> [<revision>...] -- [<file>...]'                                                        
                                                                                                      
│ [lefthook] cmd: [git branch  --remotes]
│ [lefthook] dir: /Users/trobrock/Sites/comfortly/inn_management
│ [lefthook] err: exit status 128
│ [lefthook] out: fatal: ' --remotes' is not a valid branch name
                                                              
error getting files: exit status 128
│  rspec (skip) error
                                      
  ────────────────────────────────────
summary: (skip) empty          

Possible Solution

It seems like this PR is likely related: #606

Logs / Screenshots

Above is with verbose output.

Running git branch --remotes locally does work:

 % bash -c 'git branch  --remotes'
  origin/HEAD -> origin/main
  origin/admin-dashboard
  origin/ai-reviews
  origin/auto-save-checklist
  origin/blog-posts
  origin/checklists
  origin/colorwow
  origin/digital-ocean-kamal
  origin/disable-stay-overs
  origin/fix-asset-url
  origin/main
  origin/mentions
  origin/message-board
  origin/new-ai-reviews
  origin/notifications
  origin/old
  origin/pause
  origin/pwa
  origin/review-copy
  origin/rezstream-stats
  origin/roles
@trobrock trobrock added the bug Something isn't working label Jan 17, 2024
@mrexox
Copy link
Member

mrexox commented Jan 17, 2024

Thank you for creating this issue! The fix will be published ASAP

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants