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

Fix branch preview for branches that have the same name as a file #374

Merged
merged 1 commit into from
Mar 30, 2024

Conversation

sandr01d
Copy link
Collaborator

Check list

  • I have performed a self-review of my code
  • I have commented my code in hard-to-understand areas
  • I have made corresponding changes to the documentation

Description

The preview for branches (when using gbd or gcb) did not work for branches that have the same name as a file in the repository.
The preview creates the following error message when adding a branch called 'LICENSE' to this repository and trying to preview it:

fatal: ambiguous argument 'LICENSE': both revision and filename                                                                                     

Use '--' to separate paths from revisions, like this:                                                                                               

'git <command> [<revision>...] -- [<file>...]'

This PR fixes this behavior by separating files and revisions with '--' as git suggests, while leaving the files blank to keep matching all files.

Type of change

  • Bug fix
  • New feature
  • Refactor
  • Breaking change
  • Documentation change

Test environment

  • Shell
    • bash
    • zsh
    • fish
  • OS
    • Linux
    • Mac OS X
    • Windows
    • Others:

@carlfriedrich
Copy link
Collaborator

Good catch! Can reproduce the error, and the fix works for me. Thanks!

@sandr01d sandr01d merged commit 032b52f into wfxr:master Mar 30, 2024
4 checks passed
@sandr01d sandr01d deleted the fix-branch-preview branch April 5, 2024 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants