Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
qt-creator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tobias Hunger
qt-creator
Commits
8e5edbec
Commit
8e5edbec
authored
14 years ago
by
Robert Loehning
Browse files
Options
Downloads
Patches
Plain Diff
VCS[git]: Allow diff with current or remote branch
parent
0d187323
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/plugins/git/branchdialog.cpp
+14
-11
14 additions, 11 deletions
src/plugins/git/branchdialog.cpp
with
14 additions
and
11 deletions
src/plugins/git/branchdialog.cpp
+
14
−
11
View file @
8e5edbec
...
...
@@ -160,16 +160,15 @@ void BranchDialog::slotEnableButtons(const QItemSelection &selected)
}
// We can switch to or delete branches that are not current.
const
bool
hasRepository
=
!
m_repository
.
isEmpty
();
const
int
selectedLocalRow
=
selectedLocalBranchIndex
();
const
int
currentLocalBranch
=
m_
localModel
->
currentBranch
();
const
bool
has
Selection
=
selectedLocalRow
!=
-
1
&&
!
m_localModel
->
isNewBranchRow
(
selectedLocalRow
);
const
bool
currentIsNot
Selected
=
hasSelection
&&
selected
LocalRow
!=
currentLocalBranch
;
const
bool
hasRepository
=
!
m_
repository
.
isEmpty
();
const
bool
hasLocalSelection
=
selectedLocalRow
!=
-
1
&&
!
m_localModel
->
isNewBranchRow
(
selectedLocalRow
);
const
bool
otherLocalSelected
=
hasLocal
Selection
&&
selectedLocalRow
!=
m_localModel
->
currentBranch
(
);
const
bool
branch
Selected
=
has
Local
Selection
||
selected
RemoteBranchIndex
()
!=
-
1
;
m_checkoutButton
->
setEnabled
(
currentIsNot
Selected
);
m_diffButton
->
setEnabled
(
currentIsNot
Selected
);
m_deleteButton
->
setEnabled
(
currentIsNot
Selected
);
m_checkoutButton
->
setEnabled
(
otherLocal
Selected
);
m_diffButton
->
setEnabled
(
branch
Selected
);
m_deleteButton
->
setEnabled
(
otherLocal
Selected
);
m_refreshButton
->
setEnabled
(
hasRepository
);
// Also disable <New Branch> entry of list view
m_ui
->
localBranchListView
->
setEnabled
(
hasRepository
);
...
...
@@ -249,10 +248,14 @@ void BranchDialog::slotLocalBranchActivated()
void
BranchDialog
::
slotDiffSelected
()
{
const
int
idx
=
selectedLocalBranchIndex
();
if
(
idx
==
-
1
)
int
idx
=
selectedLocalBranchIndex
();
if
(
idx
!=
-
1
)
{
gitClient
()
->
diffBranch
(
m_repository
,
QStringList
(),
m_localModel
->
branchName
(
idx
));
return
;
gitClient
()
->
diffBranch
(
m_repository
,
QStringList
(),
m_localModel
->
branchName
(
idx
));
}
idx
=
selectedRemoteBranchIndex
();
if
(
idx
!=
-
1
)
gitClient
()
->
diffBranch
(
m_repository
,
QStringList
(),
m_remoteModel
->
branchName
(
idx
));
}
/* Ask to stash away changes and then close dialog and do an asynchronous
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment