stagit

static git page generator  https://git.ce9e.org
git clone https://git.ce9e.org/stagit.git

commit
36d9a8f957389fd46146b4f16725eb00e7a48672
parent
b415162d464dc08196bca882bf64299073a7efc4
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2023-08-07 18:46
refactor: split out touch()

Diffstat

M gitolite/stagit.py 8 ++++++--

1 files changed, 6 insertions, 2 deletions


diff --git a/gitolite/stagit.py b/gitolite/stagit.py

@@ -29,6 +29,11 @@ def create_sh_script(path, lines):
   29    29 		os.unlink(path)
   30    30 
   31    31 
   -1    32 def touch(path):
   -1    33 	with open(path, 'a'):
   -1    34 		os.utime(path, None)
   -1    35 
   -1    36 
   32    37 def get_repo_dir(repo):
   33    38 	return os.path.join(REPO_DIR, repo + '.git')
   34    39 
@@ -70,8 +75,7 @@ def update_repo(repo):
   70    75 			'python3 -c \'import os, stagit; '
   71    76 			'stagit.render_repo(os.environ["STAGIT_REPO"])\''
   72    77 		)
   73    -1 		with open(export_ok, 'a'):
   74    -1 			os.utime(export_ok, None)
   -1    78 		touch(export_ok)
   75    79 	else:
   76    80 		if os.path.exists(export_ok):
   77    81 			os.unlink(export_ok)