Use current branch name in gitShowReason(), not just master
This commit is contained in:
parent
edeff35d7e
commit
355b28ba40
@ -114,16 +114,14 @@ bool GitClient::gitCloneAndCheckoutBranch() {
|
||||
return false;
|
||||
}
|
||||
|
||||
QStringList GitClient::gitShowReason() {
|
||||
QStringList GitClient::gitShowReason(QString branchName) {
|
||||
QStringList lst;
|
||||
if (QDir(m_customerRepository).exists()) {
|
||||
// %h: commit (short form)
|
||||
// %s: commit message
|
||||
// %cI: commit date, strict ISO 8601 format
|
||||
// Note: use master branch. By convention, there is a ChangeLog file
|
||||
// in the root of the repository, which has to be always the last file
|
||||
// to be checked in when the customer repository somehow changed.
|
||||
Command c("git show origin/master -s --format=\"c=%h m=%s d=%cI\"");
|
||||
// Note: branch with branchName has to exist: format zg1/zone1
|
||||
Command c(QString("git show origin/%1 -s --format=\"c=%h m=%s d=%cI\"").arg(branchName));
|
||||
if (c.execute(m_customerRepository)) {
|
||||
QString const s = c.getCommandResult().trimmed();
|
||||
int const c = s.indexOf("c=");
|
||||
|
@ -50,7 +50,7 @@ class GitClient : public QObject {
|
||||
std::optional<QStringList> gitMerge();
|
||||
|
||||
QString gitLastCommit(QString fileName);
|
||||
QStringList gitShowReason();
|
||||
QStringList gitShowReason(QString branchName);
|
||||
static QString gitBlob(QString fileName);
|
||||
QString gitCommitForBlob(QString blob);
|
||||
bool gitIsFileTracked(QString file2name);
|
||||
|
Loading…
Reference in New Issue
Block a user