Skip to content

Commit

Permalink
fix: do not call git checkout unless necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
gebner authored and tydeu committed May 15, 2022
1 parent 85b1c0f commit 42ea5f2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Lake/Config/Resolve.lean
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ cloning and/or updating it as necessary.
def materializeGit
(name : String) (dir : FilePath) (url rev : String) : (LogT IO) PUnit := do
if ← dir.isDir then
logInfo s!"{name}: trying to update {dir} to revision {rev}"
let hash ← parseOriginRevision rev dir
if (← headRevision dir) == hash then return
logInfo s!"{name}: trying to update {dir} to revision {rev}"
unless ← revisionExists hash dir do fetch dir
checkoutDetach hash dir
else
Expand Down

0 comments on commit 42ea5f2

Please sign in to comment.