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