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

git branches with / in it are cut-off #12

Closed
dgollub opened this issue May 8, 2015 · 0 comments
Closed

git branches with / in it are cut-off #12

dgollub opened this issue May 8, 2015 · 0 comments

Comments

@dgollub
Copy link
Contributor

dgollub commented May 8, 2015

When a git branch has a / in it, promptd will not display the name correctly.

Example:

dkg@dkg:~/D/o/django-grappelli [2.7.x]$ cat .git/HEAD 
ref: refs/heads/dev/2.7.x
dkg@dkg:~/D/o/django-grappelli [2.7.x]$ git branch -v
* dev/2.7.x ded3430 Merge pull request #603 from mochawich/patch-1
  master    52ba68c changelog update
dkg@dkg:~/D/o/django-grappelli [2.7.x]$ promptd-vcs 
[2.7.x]

The issue is in git.d on line 148

// If we're on a branch head, .git/HEAD will look like
// ref: refs/heads/<branch>
if (headSHA.startsWith("ref:"))
    return headSHA.baseName;

The return headSHA.baseName will cut off at the wrong /.

dgollub added a commit to dgollub/promptd that referenced this issue May 8, 2015
This fixes the cut off branch names when a branch has a / in the name.
Example: "dev/2.7.x" was cut off to "2.7.x".
mrkline added a commit that referenced this issue May 15, 2015
Fix issue #12 branches with / in it are cut-off
@mrkline mrkline closed this as completed May 15, 2015
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

No branches or pull requests

2 participants