diff options
author | Daniel Silverstone <dsilvers@digital-scurf.org> | 2012-09-10 19:29:27 +0100 |
---|---|---|
committer | Daniel Silverstone <dsilvers@digital-scurf.org> | 2012-09-10 19:29:27 +0100 |
commit | a70b16481c548fe31e18ee2f0724b5810c8b1b5c (patch) | |
tree | 54496500d2a1735e639c9e1edf87564ff67be166 | |
parent | 80cfdf19f3675f021aa0379af649f80abfeb555b (diff) | |
download | gitano-a70b16481c548fe31e18ee2f0724b5810c8b1b5c.tar.gz |
GITANO: Move the force_empty_tree() call from always, to update-hook and only if needed
-rw-r--r-- | bin/gitano-update-hook.in | 3 | ||||
-rw-r--r-- | lib/gitano/repository.lua | 4 |
2 files changed, 3 insertions, 4 deletions
diff --git a/bin/gitano-update-hook.in b/bin/gitano-update-hook.in index 446393a..e838244 100644 --- a/bin/gitano-update-hook.in +++ b/bin/gitano-update-hook.in @@ -111,6 +111,9 @@ end local function do_expensive_populate_context(context) local oldtree, newtree + if oldsha == nullsha or newsha == nullsha then + repo.git:force_empty_tree() + end if oldsha == nullsha then oldtree = repo.git:get(gall.tree.empty_sha).content diff --git a/lib/gitano/repository.lua b/lib/gitano/repository.lua index 9e6460c..f0c05f0 100644 --- a/lib/gitano/repository.lua +++ b/lib/gitano/repository.lua @@ -148,10 +148,6 @@ function repo_method:run_checks() return nil, msg end - -- Finally force the empty tree to exist since Git pre 1.7.4 doesn't - -- support it. - self.git:force_empty_tree() - -- And all is well return true end |