]> Savannah Git Hosting - gnulib.git/commitdiff
gnulib-tool.py: Fix 'git update-index' call when using hard links.
authorCollin Funk <collin.funk1@gmail.com>
Sat, 16 Mar 2024 18:47:05 +0000 (11:47 -0700)
committerBruno Haible <bruno@clisp.org>
Sat, 16 Mar 2024 22:57:53 +0000 (23:57 +0100)
* 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.

ChangeLog
pygnulib/main.py

index 44ff5a5475305a25bc16c21d64fff1b8b09e3cd6..9f784564402e242a7077c34dc0947bc2eef7b9ce 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+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().
index a3db7bb7c761cd996a859bff276c746bd8415e6f..5d88d0115ae10679fa66d9d7b3b2b7daa3578853 100644 (file)
@@ -1279,7 +1279,7 @@ def main():
         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
@@ -1287,9 +1287,9 @@ def main():
         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