Skip to content

Commit

Permalink
Only warn about uncommitted changes before merge when not up to date
Browse files Browse the repository at this point in the history
  • Loading branch information
MariusDoe committed Dec 10, 2024
1 parent 6d32011 commit ca2d66d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ mergeCommitIntoHead: aCommit displayName: aString
self activeWorkingCopyIfNilInformAnd: [^ self].
aCommit ifNil: [^ self inform:
('Cannot merge {1}, it does not refer to a commit.' format: {aString})].
self warnIfImageNotClean: [^ self].
head := self activeWorkingCopy headCommitIfNilInformAnd: [^ self].
mergeBases := GSGUIUtilities
displayStatus: 'Looking for a merge base'
Expand All @@ -13,7 +12,12 @@ mergeCommitIntoHead: aCommit displayName: aString
[0] -> [^ self inform: 'Cannot merge unrelated histories.'].
[1] -> [mergeBases anyOne].
} otherwise: [^ self inform: 'Found multiple merge bases. Recursive merging is currently unsupported.'].
mergeBase = aCommit ifTrue: [^ self inform: 'Already up to date.'].
mergeBase = aCommit ifTrue: [ | message |
message := 'Already up to date.'.
self activeWorkingCopy isImageClean ifFalse: [
message := message, ' You have uncommitted changes.'].
^ self inform: message].
self warnIfImageNotClean: [^ self].
mergeBase = head ifTrue: [
^ (self
openDialogToMaterializeCommit: aCommit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
"menu:forCommit:ref:" : "mad 12/2/2024 01:01",
"menu:forRef:" : "mad 11/16/2024 16:14",
"mergeCommitIntoHead:" : "mad 9/21/2023 13:47",
"mergeCommitIntoHead:displayName:" : "mad 11/16/2024 12:49",
"mergeCommitIntoHead:displayName:" : "mad 12/10/2024 12:07",
"mergeCommitIntoHead:mergeBase:message:windowTitle:alwaysOpenDialog:commitType:" : "mad 10/9/2024 16:01",
"mergeRefIntoHead:" : "mad 9/18/2023 17:22",
"newProject:" : "mad 3/19/2024 21:29",
Expand Down

0 comments on commit ca2d66d

Please sign in to comment.