MCPcopy Create free account
hub / github.com/ReZeroS/git / run

Method run

src/main/java/club/qqtim/command/Branch.java:41–55  ·  view source on GitHub ↗

Pay attention, only you create a commit at branch, the branch will generate at real so if you execute `zit init`, then `zit branch` immediately will get nothing, this is not a bug.

()

Source from the content-addressed store, hash-verified

39 * so if you execute `zit init`, then `zit branch` immediately will get nothing, this is not a bug.
40 */
41 @Override
42 public void run() {
43 // none name for readable command
44 if(ConstantVal.NONE.equals(name)) {
45 final String currentBranch = ZitContext.getBranchName();
46 final List<String> branchNames = iteratorBranchNames();
47 branchNames.forEach(branchName ->
48 log.info("{} {}", branchName.equals(currentBranch) ? ConstantVal.STAR : ConstantVal.EMPTY, branchName)
49 );
50 } else {
51 // got name for branch will be created base on the commit point
52 createBranch(name, startPoint);
53 log.info("created branch {} at {}", name, startPoint.substring(0, 11));
54 }
55 }
56
57 /**
58 * list all branches in the repository

Callers

nothing calls this directly

Calls 3

getBranchNameMethod · 0.95
iteratorBranchNamesMethod · 0.95
createBranchMethod · 0.95

Tested by

no test coverage detected