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

Fixes #893 - unquoted branch names in merge #894

Merged
merged 1 commit into from Nov 11, 2019
Merged

Conversation

@bees4ever
Copy link
Contributor

bees4ever commented Oct 31, 2019

Description

I try to fix issue #893. Branch names are quoted now, while merging:
git merge "#test". Before the generated command called: git merge "#test" wich does nothing, as # works like a comment in bash.

Checklist

  • I have followed the guidelines in the Contributing document
  • My changes are based off of the develop branch
  • My changes follow the coding style of this project
  • My changes build without any errors or warnings
  • My changes have been formatted and linted
  • My changes include any required corresponding changes to the documentation
  • My changes have been rebased and squashed to the minimal number (typically 1) of relevant commits
  • My changes have a descriptive commit message with a short title, including a Fixes $XXX - or Closes #XXX - prefix to auto-close the issue that your PR addresses
@@ -652,7 +652,8 @@ export class Repository implements Disposable {
}

private runTerminalCommand(command: string, ...args: any[]) {
runGitCommandInTerminal(command, args.join(' '), this.path, true);
const parsedArgs = args.map(arg => (arg.indexOf('#') >= 0 ? `"${arg}"` : arg));

This comment has been minimized.

Copy link
@eamodio

eamodio Nov 5, 2019

Owner

@bees4ever Does this need to be >= 0 rather than just === 0? Will the shell treat it as a comment even within a string?

This comment has been minimized.

Copy link
@bees4ever

bees4ever Nov 12, 2019

Author Contributor

@eamodio sorry for the late replay, I saw you merged it now, wow :D I am very happy. Yes, string like "#my-branch-name" will be then not interpreted as comment. I choose >= 0 because a branch name could (I don't know why, but however) call fix-#1234.

This comment has been minimized.

Copy link
@eamodio

eamodio Nov 12, 2019

Owner

@bees4ever I tried it out with a branch like fix-#1234 and it seemed to be fine without the quoting. Please let me know if you try it an see otherwise

This comment has been minimized.

Copy link
@bees4ever

bees4ever Nov 12, 2019

Author Contributor

@eamodio Yes, correct, it works perfect, so however, my assumption was wrong. Anyway the bug is fixed. Thanks again.

@eamodio eamodio merged commit ab5b551 into eamodio:develop Nov 11, 2019
@eamodio

This comment has been minimized.

Copy link
Owner

eamodio commented Nov 11, 2019

Thank you for your contribution!

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.