[GH-ISSUE #41] If there are branches whose names include slash(/) in local, KeyError will occur on any operations. #31

Closed
opened 2026-03-02 16:47:20 +03:00 by kerem · 3 comments
Owner

Originally created by @polisherm on GitHub (Jan 29, 2023).
Original GitHub issue: https://github.com/initialcommit-com/git-sim/issues/41

A git branch name can include slash symbol(/).
e.g) feature/feature-A

However, git-sim throws KeyError if the branches's name include slash.
There is the reason most likely in following lines.
github.com/initialcommit-com/git-sim@84811ee252/git_sim/git_sim_base_command.py (L319-L327)

This if-statement conditional branch is insufficient.
If possible, could you consider other means of determining whether a branch is a remote branch or not?
I also try to explore the way. (I am not familiar with Python and Git, so it is perhaps difficult for me to make Pull Request about this issue.)

Originally created by @polisherm on GitHub (Jan 29, 2023). Original GitHub issue: https://github.com/initialcommit-com/git-sim/issues/41 A git branch name can include slash symbol(/). e.g) feature/feature-A However, `git-sim` throws `KeyError` if the branches's name include slash. There is the reason most likely in following lines. https://github.com/initialcommit-com/git-sim/blob/84811ee2523067296a4c7115506e10e713e9f8f0/git_sim/git_sim_base_command.py#L319-L327 This if-statement conditional branch is insufficient. If possible, could you consider other means of determining whether a branch is a remote branch or not? I also try to explore the way. (I am not familiar with Python and Git, so it is perhaps difficult for me to make Pull Request about this issue.)
kerem closed this issue 2026-03-02 16:47:20 +03:00
Author
Owner

@initialcommit-io commented on GitHub (Jan 29, 2023):

@k1997y Yes you're right. I will use the supported GitPython calls to determine if the branch is local or remote, instead of this slash test. I will push a fix for this soon. Thanks for finding and reporting this bug!

<!-- gh-comment-id:1407715732 --> @initialcommit-io commented on GitHub (Jan 29, 2023): @k1997y Yes you're right. I will use the supported GitPython calls to determine if the branch is local or remote, instead of this slash test. I will push a fix for this soon. Thanks for finding and reporting this bug!
Author
Owner

@initialcommit-io commented on GitHub (Jan 29, 2023):

@k1997y Just pushed a fix for this in new version 0.1.8. Please update using:

$ pip install git-sim --upgrade

And let me know if it works now! I will close this for now but feel free to reopen if any issues.

<!-- gh-comment-id:1407721455 --> @initialcommit-io commented on GitHub (Jan 29, 2023): @k1997y Just pushed a fix for this in new version 0.1.8. Please update using: ``` $ pip install git-sim --upgrade ``` And let me know if it works now! I will close this for now but feel free to reopen if any issues.
Author
Owner

@polisherm commented on GitHub (Jan 30, 2023):

@initialcommit-io
Thank you for your very quick response and fixing!!
I expect you to make this product better, Thank you very much.

<!-- gh-comment-id:1407910703 --> @polisherm commented on GitHub (Jan 30, 2023): @initialcommit-io Thank you for your very quick response and fixing!! I expect you to make this product better, Thank you very much.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/git-sim#31
No description provided.