From d53596770d004fc035ca311c86a54f4c01412b8f Mon Sep 17 00:00:00 2001 From: Colin Guthrie Date: Sat, 4 Jan 2014 14:50:36 +0000 Subject: mgagit: Fix last-modified file write. --- deployment/mgagit/templates/git-post-receive-hook | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'deployment/mgagit') diff --git a/deployment/mgagit/templates/git-post-receive-hook b/deployment/mgagit/templates/git-post-receive-hook index e5c60f39..f0e71619 100755 --- a/deployment/mgagit/templates/git-post-receive-hook +++ b/deployment/mgagit/templates/git-post-receive-hook @@ -176,8 +176,10 @@ if __name__ == '__main__': lastupdated = git_multimail.read_git_output( ['for-each-ref', '--sort=-committerdate', "--format='%(committerdate:iso8601)'", '--count=1', 'refs/heads'], ) - open(os.path.join(infowebdir, 'last-modified'), 'w').write(lastupdated).close() - except IOError: + modfile = open(os.path.join(infowebdir, 'last-modified'), 'w') + modfile.write(lastupdated) + modfile.close() + except Exception: pass git_multimail.main(sys.argv[1:]) -- cgit v1.2.1