Skip to content

Commit

Permalink
Merge branch 'release/0.9.0' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
j4yk committed Dec 1, 2020
2 parents b37f114 + b65ca72 commit ab2dc14
Show file tree
Hide file tree
Showing 1,463 changed files with 6,244 additions and 3,190 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
accessing
commitNamed: hexHash
| git |
git := GitCurrentUnitOfWork for: repository.
git := repository unitOfWork.
^ self filesystemOn: (git objectNamed: hexHash)
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
accessing
head
^ self filesystemOn: (self unitOfWork headIfAbsent: [ nil ])
^ self filesystemOn: (repository withUnitOfWork: [repository unitOfWork headIfAbsent: [ nil ]])

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,22 @@
"branchNames" : "jr 3/3/2020 21:45",
"branches" : "jr 3/4/2020 00:46",
"cloneFrom:" : "jr 8/8/2020 01:17",
"commitNamed:" : "jr 8/8/2020 16:27",
"commitNamed:" : "jr 8/13/2020 23:08",
"createBranchNamed:at:" : "jr 3/4/2020 00:47",
"expandRemoteRef:" : "pre 6/15/2018 16:04",
"fetchFrom:" : "jr 9/6/2020 21:11",
"fetchFromAll:" : "jr 4/12/2017 11:26",
"filesystemOn:" : "CamilloBruni 8/30/2012 14:06",
"flushCaches" : "jr 7/2/2017 19:12",
"gitStoreOn:" : "CamilloBruni 9/2/2012 12:33",
"head" : "jr 2/29/2020 20:50",
"head" : "jr 8/13/2020 23:10",
"headReference" : "jr 3/4/2020 00:47",
"initializeOn:" : "MaxLeske 7/23/2010 09:59",
"orphanedHead" : "jr 1/29/2017 22:52",
"push:toRemote:" : "jr 1/2/2017 10:20",
"pushToRemote:deleteRemoteBranches:" : "jr 1/2/2017 10:18",
"pushToRemote:update:deleteRemoteBranches:" : "jr 7/23/2020 00:43",
"pushToUpstreamBranchOf:ifNone:" : "jr 3/4/2020 00:49",
"recursivelyCollectCommits:into:" : "MaxLeske 8/25/2011 19:16",
"recursivelyCollectCommits:into:limit:" : "jr 3/2/2017 10:39",
"remoteNames" : "jr 7/22/2020 22:02",
"remoteUrl:" : "jr 3/4/2020 00:46",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ running
setUp
| commit1 commit2 blob1 blob2 tree1 tree2 stamp |
super setUp.
stamp := GitStamp new
name: 'Homer Simpson';
email: '[email protected]';
yourself.
stamp := GitStamp nowBy: 'Homer Simpson'
email: '[email protected]'.
reference := (FileSystem memory / 'test.git').
basicRepository := GitRepository on: reference.

basicRepository withUnitOfWork: [
blob1 := (GitBlob bytes: 'testBlob' in: basicRepository) store; yourself.
blob2 := (GitBlob bytes: 'second test Blob' in: basicRepository) store; yourself.
tree1 := GitTree
Expand Down Expand Up @@ -45,10 +44,11 @@ setUp
parents: { commit1 hexHash };
store;
yourself.
basicRepository
updateRef: basicRepository headsDir / 'branch1' to: commit1 hexHash;
updateRef: basicRepository headsDir / 'master' to: commit2 hexHash.

basicRepository unitOfWork
updateRef: 'refs/heads/branch1' to: commit1 hexHash;
updateRef: 'refs/heads/master' to: commit2 hexHash.
GitFSCK validate: basicRepository.
].

repository := FileSystemGitRepository on: reference.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
running
tearDown
GitFSCK validate: basicRepository.
basicRepository withUnitOfWork: [GitFSCK validate: basicRepository].
super tearDown.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ tests
testClone
| repo master |
repo := FileSystemGitRepository on: FileSystem memory root.
repo cloneFrom: self remoteUrl.
repo withUnitOfWork: [repo cloneFrom: self remoteUrl].
repo withUnitOfWork: [
self assert: (repo branches includesKey: 'master')
description: 'should have obtained master, got: ', (repo branches keys joinSeparatedBy: ' ').
master := repo branches at: 'master'.
self assert: (master / 'README.md') exists.
self shouldnt: [repo validate] raise: Error.
self shouldnt: [repo validate] raise: Error.
].
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ testPush
<timeout: 20>
"when"
| remoteRefs |
self withUnitOfWork: [
repository addRemote: 'test' url: self remoteUrl.
repository push: { 'branch1' } toRemote: 'test'.
].
"then"
remoteRefs := (GitAbstractProtocol url: self remoteUrl) refs.
self assert: (remoteRefs includesKey: 'refs/heads/branch1').
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ testPushCreateUpdateDelete
<timeout: 20>
| remoteRefs master |
"given"
self withUnitOfWork: [
repository addRemote: 'test' url: self remoteUrl.
"when"
repository push: { 'branch1' -> 'test/branch1'. 'master' -> 'test/branch2' } toRemote: 'test'.
Expand All @@ -19,4 +20,5 @@ testPushCreateUpdateDelete
self assert: (repository branchNamed: 'oldmaster') revision hexHash
equals: (remoteRefs at: 'refs/heads/test/oldmaster').
"finally"
repository pushToRemote: 'test' deleteRemoteBranches: { 'test/branch2'. 'test/oldmaster' }.
repository pushToRemote: 'test' deleteRemoteBranches: { 'test/branch2'. 'test/oldmaster' }.
].
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
tests
withUnitOfWork: aBlock
^ repository withUnitOfWork: aBlock
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
"expectedFailures" : "jr 4/12/2017 14:04",
"remoteUrl" : "jr 1/31/2017 15:21",
"repository" : "jr 4/13/2020 21:25",
"setUp" : "jr 1/31/2017 15:21",
"tearDown" : "jr 2/23/2017 12:49",
"testClone" : "jr 4/12/2017 16:47",
"testPush" : "jr 1/31/2017 15:21",
"testPushCreateUpdateDelete" : "jr 1/31/2017 15:21" } }
"setUp" : "jr 8/26/2020 23:26",
"tearDown" : "jr 8/17/2020 00:06",
"testClone" : "jr 8/17/2020 00:05",
"testPush" : "jr 8/23/2020 18:39",
"testPushCreateUpdateDelete" : "jr 8/23/2020 18:40",
"withUnitOfWork:" : "jr 8/23/2020 18:39" } }
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"category" : "FileSystem-Git-Tests",
"classinstvars" : [
],
"classtraitcomposition" : "TGitTestCaseWithUnitOfWork classTrait",
"classvars" : [
],
"commentStamp" : "",
Expand All @@ -13,4 +14,5 @@
"pools" : [
],
"super" : "GitTestCase",
"traitcomposition" : "TGitTestCaseWithUnitOfWork",
"type" : "normal" }
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ running
setUp
| commit1 commit2 blob1 blob2 tree1 tree2 stamp |
super setUp.
stamp := GitStamp new
name: 'Homer Simpson';
email: '[email protected]';
yourself.
stamp := GitStamp nowBy: 'Homer Simpson'
email: '[email protected]'.
reference := (FileSystem memory / 'test.git').
basicRepository := GitRepository on: reference.

basicRepository withUnitOfWork: [
blob1 := (GitBlob bytes: 'testBlob' in: basicRepository) store; yourself.
blob2 := (GitBlob bytes: 'second test Blob' in: basicRepository) store; yourself.
tree1 := GitTree
Expand Down Expand Up @@ -46,9 +45,10 @@ setUp
store;
yourself.

basicRepository
updateRef: basicRepository headsDir / 'branch1' to: commit1 hexHash;
updateRef: basicRepository headsDir / 'master' to: commit2 hexHash.
GitFSCK validate: basicRepository.
basicRepository unitOfWork
updateRef: 'refs/heads/branch1' to: commit1 hexHash;
updateRef: 'refs/heads/master' to: commit2 hexHash.
].
basicRepository withUnitOfWork: [GitFSCK validate: basicRepository].

repository := FileSystemGitRepository on: reference.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
running
tearDown
GitFSCK validate: basicRepository.
basicRepository withUnitOfWork: [GitFSCK validate: basicRepository].
super tearDown.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
tests
testFullTags
| commit tags tag|
commit := basicRepository objectNamed: (basicRepository resolveRef: 'refs/heads/branch1').
commit := self unitOfWork objectNamed: (self unitOfWork resolveRef: 'refs/heads/branch1').
[[ tag := GitTag
named: 'version4.3alpha'
for: commit
Expand All @@ -11,7 +11,6 @@ testFullTags
do: [ :req | req resume: 'Homer Simpson' ]]
on: GitStampEmailRequest
do: [ :req | req resume: '[email protected]' ].

tags := repository tags.

self assert: tags size = 1.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
tests
testHead
| head fsOnHead |
head := basicRepository objectNamed: basicRepository headRef.
head := self unitOfWork objectNamed: self unitOfWork headRef.
fsOnHead := repository head.
self assert: fsOnHead species = GitFilesystem.
self assert: head = (fsOnHead revision)
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
tests
testLightTags
| master branch1 tags |
master := basicRepository resolveRef: 'refs/heads/master'.
branch1 := basicRepository resolveRef: 'refs/heads/branch1'.
basicRepository
updateRef: basicRepository tagsDir / 'version4.3alpha' to: master;
updateRef: basicRepository tagsDir / 'fail' to: branch1.

| master branch1 tags git |
git := self unitOfWork.
master := git resolveRef: 'refs/heads/master'.
branch1 := git resolveRef: 'refs/heads/branch1'.
git
updateRef: 'refs/tags/version4.3alpha' to: master;
updateRef: 'refs/tags/fail' to: branch1.
tags := repository tags.
self assert: tags size = 2.
tags do: [ :each |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,22 @@ tests
testNewOrphanedCommit
"When starting from no revision, the GitFilesystem should be empty.
There was an error that a new orphaned commit would contain files from HEAD."
| headCommit workingCopy masterCommit newCommit |
| git headCommit workingCopy masterCommit newCommit |
"given"
headCommit := basicRepository objectNamed: basicRepository headRef.
git := self unitOfWork.
headCommit := git objectNamed: git headRef.
self assert: headCommit notNil;
assert: repository head root entries notEmpty.
masterCommit := basicRepository branchNamed: 'master'.
masterCommit := git branchNamed: 'master'.
self assert: masterCommit notNil.
"when"
workingCopy := repository branchNamed: 'new'.
"then"
self assert: workingCopy root entries isEmpty.
(workingCopy / 'file') ensureFile.
workingCopy branch: 'new' message: 'new orphan commit'.
newCommit := basicRepository branchNamed: 'new'.
newCommit := git branchNamed: 'new'.
self assert: newCommit parents isEmpty;
assert: masterCommit equals: (basicRepository branchNamed: 'master')
assert: masterCommit equals: (git branchNamed: 'master')
description: 'master should not be modified by the new branch';
assert: ((repository branchNamed: 'new') root entries collect: #asFileReference) = (workingCopy root entries collect: #asFileReference).
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ tests
testTags
self assert: repository tags isEmpty.

basicRepository
updateRef: basicRepository tagsDir / 'tag1'
to: basicRepository head hexHash.
self unitOfWork
updateRef: 'refs/tags/tag1'
to: self unitOfWork head hexHash.
self assert: repository tags size = 1.
self assert: (repository tags includes: repository head).

basicRepository
updateRef: basicRepository tagsDir / 'tag2'
to: basicRepository head parents first hexHash.
self unitOfWork
updateRef: 'refs/tags/tag2'
to: self unitOfWork head parents first hexHash.
self assert: repository tags size = 2.
self assert: (repository tags includes: repository head).
self assert: (repository tags includes: repository head parents first)
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
"lastStoredRun" : "CamilloBruni 8/1/2011 16:49" },
"instance" : {
"repository" : "jr 4/13/2020 21:25",
"setUp" : "CamilloBruni 9/3/2012 18:53",
"tearDown" : "jr 2/23/2017 12:49",
"setUp" : "jr 8/26/2020 23:26",
"tearDown" : "jr 8/17/2020 00:08",
"testAddAndCommitting" : "jr 3/7/2017 17:17",
"testBranches" : "jr 3/6/2017 14:45",
"testFullTags" : "pre 11/14/2018 16:24",
"testHead" : "CamilloBruni 9/1/2012 12:39",
"testLightTags" : "pre 11/14/2018 16:24",
"testNewOrphanedCommit" : "jr 2/23/2019 22:54",
"testFullTags" : "jr 8/24/2020 14:43",
"testHead" : "jr 8/24/2020 14:43",
"testLightTags" : "jr 8/24/2020 14:44",
"testNewOrphanedCommit" : "jr 8/24/2020 14:44",
"testRemoveAndCommitting" : "jr 12/15/2016 16:54",
"testTags" : "CamilloBruni 9/2/2012 11:12",
"testTags" : "jr 8/23/2020 16:48",
"testVersions" : "CamilloBruni 9/3/2012 18:32",
"testVersionsOrder" : "CamilloBruni 9/3/2012 16:20" } }
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"category" : "FileSystem-Git-Tests",
"classinstvars" : [
],
"classtraitcomposition" : "TGitActiveUnitOfWorkDuringTest classTrait",
"classvars" : [
],
"commentStamp" : "",
Expand All @@ -13,4 +14,5 @@
"pools" : [
],
"super" : "GitTestCase",
"traitcomposition" : "TGitActiveUnitOfWorkDuringTest",
"type" : "normal" }
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,14 @@ testInitializeWithEverything
| commit tree message author committer blob |
blob := GitBlob bytes: 'aBlob' in: nil.
message := 'a test message'.
author := (GitStamp new
email: '[email protected]';
name: 'Homer Simpson';
timeStamp: TimeStamp now;
yourself).
committer := (GitStamp new
email: '[email protected]';
name: 'Bart Simpson';
timeStamp: TimeStamp now;
yourself).
author := GitStamp
name: 'Homer Simpson'
email: '[email protected]'
timeStamp: TimeStamp now.
committer := GitStamp
name: 'Bart Simpson'
email: '[email protected]'
timeStamp: TimeStamp now.
tree := GitTree
entries: {
GitTreeEntry
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"testEncodingWithDefaultUtf8" : "jr 4/6/2020 23:04",
"testEncodingWithLatin1" : "jr 4/6/2020 23:04",
"testHashWithGpgSignature" : "jr 5/26/2017 19:41",
"testInitializeWithEverything" : "CamilloBruni 9/3/2012 18:59",
"testInitializeWithEverything" : "jr 8/26/2020 23:05",
"testPrintOn" : "jr 5/2/2020 16:42",
"testRetrievingParents" : "jr 4/6/2020 23:04",
"testWritingSameCommitTwice" : "jr 4/13/2020 22:07" } }
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
accessing
warnAboutUseOfDeprecatedMethods
<preference: 'Warn when methods are used in a deprecated way'
<preference: 'Warn when Git methods are used in a deprecated way'
categoryList: #('Git expert settings')
description: 'Interrupt with a deprecation warning if objects are not used as they should be under the current set of settings.'
type: #Boolean>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"evictFromObjectCache" : "jr 8/10/2020 23:42",
"evictFromObjectCache:" : "jr 4/20/2020 21:59",
"evictFromObjectCacheForTests:" : "jr 4/20/2020 23:33",
"warnAboutUseOfDeprecatedMethods" : "jr 4/17/2020 11:49",
"warnAboutUseOfDeprecatedMethods" : "jr 9/21/2020 23:10",
"warnAboutUseOfDeprecatedMethods:" : "jr 4/17/2020 11:49" },
"instance" : {
} }
Loading

0 comments on commit ab2dc14

Please sign in to comment.