+2024-03-16 Collin Funk <collin.funk1@gmail.com>
+
+ gnulib-tool.py: Fix 'git update-index' call when using hard links.
+ * pygnulib/main.py: Fix conditional used to check whether 'git
+ update-index' should be called. Only catch FileNotFoundError exceptions
+ thrown when no 'git' program exists.
+
2024-03-16 Collin Funk <collin.funk1@gmail.com>
gnulib-tool.py: Coding style: Avoid not().
sys.stderr.write(message)
sys.exit(1)
- if copymode != classes.CopyAction.Copy or lcopymode != classes.CopyAction.Copy:
+ if copymode == classes.CopyAction.Hardlink or lcopymode == classes.CopyAction.Hardlink:
# Setting hard links modifies the ctime of files in the gnulib checkout.
# This disturbs the result of the next "gitk" invocation.
# Workaround: Let git scan the files. This can be done through
if isdir(joinpath(APP['root'], '.git')):
try:
sp.run(['git', 'update-index', '--refresh'],
- cwd=APP['root'], stdout=sp.DEVNULL, stderr=sp.DEVNULL)
- except Exception:
- # We did our best...
+ cwd=APP['root'], stdout=sp.DEVNULL)
+ except FileNotFoundError:
+ # No 'git' program was found.
pass