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

Build-in: git_current_branch #64

Open
Tracked by #2
superxcgm opened this issue Oct 1, 2021 · 0 comments
Open
Tracked by #2

Build-in: git_current_branch #64

superxcgm opened this issue Oct 1, 2021 · 0 comments

Comments

@superxcgm
Copy link
Owner

superxcgm commented Oct 1, 2021

Epic

Process

Description

User can use build-in comand git_current_branch to get current branch name.

AC

  1. Not in a git repo
    Given: User currently in a directory that not manage by git
    When: User type git_current_branch and hit <Enter>
    Then: No output, not error.

  2. In repo root directory and master branch
    Given: User currently in a directory that manage by git (For example, in our xcShell repo root directory /xxxx/xcShell ), and currently in master branch
    When: User type git_current_branch and hit <Enter>
    Then: Print master, no extra \n.

  3. In repo root directory and not in master branch
    Given: User currently in a directory that directly manage by git (For example, in our xcShell repo root directory /xxxx/xcShell ), and currently inxcShell/issues/54 branch
    When: User type git_current_branch and hit <Enter>
    Then: Print xcShell/issues/54, no extra \n.

  4. In repo sub directory
    Given: User currently in a directory that not manage by git, but it's ancestor's dir is manage by git (For example, in our xcShell repo directory /xxxx/xcShell/cmake-build-debug ), and currently inmaster branch
    When: User type git_current_branch and hit <Enter>
    Then: Print master, no extra \n.

  5. In repo.git directory
    Given: User currently in .git directory (For example, in our xcShell repo directory /xxxx/xcShell/.git ), and currently inmaster branch
    When: User type git_current_branch and hit <Enter>
    Then: Print {current_branch}, no extra \n.

  6. User do not install git
    Given: User currently in a directory that manage by git (For example, in our xcShell repo root directory /xxxx/xcShell ), and do not install git
    When: User type git_current_branch and hit <Enter>
    Then: No output, not error.

@superxcgm superxcgm mentioned this issue Oct 1, 2021
32 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant