9 #include "../UI/CreateBranchWindow.h" 59 git_reference *head, *branch;
62 const char *currentBranch = NULL;
67 ret = git_repository_open_ext(&repo, repoPath.String(), 0, NULL);
71 ret = git_repository_head(&head, repo);
75 currentBranch = git_reference_shorthand(head);
77 ret = git_reference_name_to_id(&commit_oid, repo,
"HEAD");
81 ret = git_commit_lookup(&commit, repo, &commit_oid);
85 ret = git_branch_create(&branch, repo, branchName.String(), commit, 0);
87 git_repository_free(repo);
89 git_libgit2_shutdown();
The Create Branch Window class.
TrackGitWindow * fCreateBranchWindow
The Create Branch Window.
static int DoCreateBranch(BString, BString)
This function creates a new branch in repo with given name.
virtual void Execute()
CreateBranch command execution.
Header file of Create Branch command.
CreateBranch(BString)
CreateBranch class constructor.
BString fRepo
The repo/directory where command is called.
The TrackGit Window class.
virtual TrackGitWindow * GetWindow()
This returns pointer to the Create Branch window.