FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat: add branch info and flag to status subcommand by SandrineP · Pull Request #11 · QuantStack/git2cpp · GitHub

Repository navigation

feat: add branch info and flag to status subcommand - #11

Merged
ianthomas23 merged 2 commits into
QuantStack:mainfrom
SandrineP:branch_wr
Jun 26, 2025
Merged

ianthomas23 merged 2 commits into
QuantStack:mainfrom
SandrineP:branch_wr

Conversation

SandrineP commented Jun 25, 2025 •
edited
Loading

Copy link
Copy Markdown
Collaborator

Add the branch information to the status subcommand when in long format (e.g. On branch main) and in short format when the branch flag is used (e.g. ## main).

Comment thread src/wrapper/refs_wrapper.cpp Outdated
p_resource=nullptr;
}

const char* reference_wrapper::get_ref_name(const repository_wrapper& rw)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I think this should return a std::string rather than const char*. When the reference_wrapper goes out of scope at the end of this function, we can't be sure if the const char* returned from git_reference_shorthand is valid or not without checking the libgit2 code or documentation. If we return a string then we're taking a copy and this is guaranteed to work.

ianthomas23 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thanks @SandrineP.

ianthomas23 merged commit fcd5972 into QuantStack:main Jun 26, 2025
SandrineP deleted the branch_wr branch June 26, 2025 08:42
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL