This repository was archived by the owner on Oct 25, 2023. It is now read-only.
File tree 6 files changed +59
-7
lines changed
6 files changed +59
-7
lines changed Original file line number Diff line number Diff line change @@ -19,10 +19,17 @@ namespace Lake
19
19
def updateGitPkg (name : String)
20
20
(repo : GitRepo) (rev? : Option String) : LogIO PUnit := do
21
21
if let some rev := rev? then
22
- if (← repo.headRevision) == rev then return
23
- logInfo s! "{ name} : updating { repo} to revision { rev} "
24
- unless ← repo.revisionExists rev do repo.fetch
25
- repo.checkoutDetach rev
22
+ if (← repo.branchExists rev) then
23
+ repo.fetch
24
+ let rev ← repo.parseOriginRevision rev
25
+ if (← repo.headRevision) == rev then return
26
+ logInfo s! "{ name} : updating { repo} to revision { rev} "
27
+ repo.checkoutDetach rev
28
+ else
29
+ if (← repo.headRevision) == rev then return
30
+ logInfo s! "{ name} : updating { repo} to revision { rev} "
31
+ unless ← repo.revisionExists rev do repo.fetch
32
+ repo.checkoutDetach rev
26
33
else
27
34
logInfo s! "{ name} : updating { repo} "
28
35
repo.pull
Original file line number Diff line number Diff line change @@ -33,7 +33,10 @@ def exec (args : Array String) (wd : Option FilePath := none) : LogIO PUnit := d
33
33
34
34
def test (args : Array String) (wd : Option FilePath := none) : LogT BaseIO Bool :=
35
35
let act : IO _ := do
36
- let child ← IO.Process.spawn {cmd := "git" , args, cwd := wd}
36
+ let child ← IO.Process.spawn {
37
+ cmd := "git" , args, cwd := wd,
38
+ stdout := IO.Process.Stdio.null, stderr := IO.Process.Stdio.null
39
+ }
37
40
return (← child.wait) == 0
38
41
act.catchExceptions fun _ => pure false
39
42
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ test: check-lake test-ci test-bootstrap test-bootstrapped
12
12
13
13
test-ci : test-tests test-examples
14
14
15
- test-tests : test-49 test-50 test-62 test-75
15
+ test-tests : test-49 test-50 test-62 test-75 test-84
16
16
17
17
test-examples : test-init test-hello test-io test-deps\
18
18
test-git test-ffi test-targets test-precompile test-scripts
@@ -21,7 +21,7 @@ test-bootstrapped: test-boostrapped-hello
21
21
22
22
clean : clean-build clean-tests clean-examples
23
23
24
- clean-tests : clean-62
24
+ clean-tests : clean-62 clean-84
25
25
26
26
clean-examples : clean-init clean-hello clean-io clean-deps\
27
27
clean-git clean-ffi clean-targets clean-precompile clean-bootstrap
@@ -137,3 +137,9 @@ clean-62:
137
137
138
138
test-75 :
139
139
cd test/75 && ./test.sh
140
+
141
+ clean-84 :
142
+ cd test/84 && ./clean.sh
143
+
144
+ test-84 :
145
+ cd test/84 && ./test.sh
Original file line number Diff line number Diff line change
1
+ /a
2
+ /b
Original file line number Diff line number Diff line change
1
+ rm -rf a
2
+ rm -rf b
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+ set -exo pipefail
3
+
4
+ LAKE=${LAKE:- ../ ../ build/ bin/ lake}
5
+
6
+ ./clean.sh
7
+
8
+ $LAKE new a
9
+ pushd a
10
+ git add .
11
+ git commit -am ' first commit in a'
12
+ popd
13
+
14
+ $LAKE new b
15
+ pushd b
16
+ cat >> lakefile.lean << EOF
17
+ require a from git "../a" @ "master"
18
+ EOF
19
+ ../$LAKE update
20
+ git add .
21
+ git commit -am ' first commit in b'
22
+ popd
23
+
24
+ pushd a
25
+ echo def hello2 := 42 >> A.lean
26
+ git commit -am ' second commit in a'
27
+ popd
28
+
29
+ pushd b
30
+ ../$LAKE update
31
+ git diff | grep -m1 manifest
32
+ popd
You can’t perform that action at this time.
0 commit comments