]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
vc-mtime: Make it work with Cygwin's 'git' command on native Windows.
authorBruno Haible <bruno@clisp.org>
Mon, 5 May 2025 09:40:06 +0000 (11:40 +0200)
committerBruno Haible <bruno@clisp.org>
Mon, 5 May 2025 09:52:33 +0000 (11:52 +0200)
* lib/vc-mtime.c: Include windows-cygpath.h.
(abs_git_checkout): Invoke windows_cygpath_w.
* modules/vc-mtime (Depends-on): Add windows-cygpath.

ChangeLog
lib/vc-mtime.c
modules/vc-mtime

index 7c790cdff30149b4fb8c2d2dad67022cf60a7651..646f7e268f3ad92ef46629a5198418d84d66cff6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2025-05-05  Bruno Haible  <bruno@clisp.org>
+
+       vc-mtime: Make it work with Cygwin's 'git' command on native Windows.
+       * lib/vc-mtime.c: Include windows-cygpath.h.
+       (abs_git_checkout): Invoke windows_cygpath_w.
+       * modules/vc-mtime (Depends-on): Add windows-cygpath.
+
 2025-05-05  Bruno Haible  <bruno@clisp.org>
 
        New module windows-cygpath.
index 4ebc249d8448244530de676c1e2d610be8879e7e..7d792ba33fd393e337d9078c5ee0cabab695a331 100644 (file)
@@ -35,6 +35,7 @@
 #include "safe-read.h"
 #include "xstrtol.h"
 #include "stat-time.h"
+#include "windows-cygpath.h"
 #include "filename.h"
 #include "xalloc.h"
 #include "xgetcwd.h"
@@ -357,7 +358,11 @@ abs_git_checkout (void)
       exitstatus =
         wait_subprocess (child, "git", true, true, true, false, NULL);
       if (exitstatus == 0)
-        return line;
+        {
+          char *line_converted = windows_cygpath_w (line);
+          free (line);
+          return line_converted;
+        }
     }
   free (line);
   return NULL;
index 207e62781c348c6e7e14293c7d9a817749a2539c..b4f74f5d36b6883d6453f35f8267f38fb9805c6d 100644 (file)
@@ -16,6 +16,7 @@ error
 getline
 xstrtol
 stat-time
+windows-cygpath
 filename
 xalloc
 xgetcwd