Package: mr
Version: 0.22
Severity: normal
Tags: patch

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

mr uses chdir() to change the working directory to each repository it
works on. However when a skip test is defined rcs_test() is called
before chdir(), and then the test for git repositories fails (since
"git config" checks that ".git" is in the current working directory).

Attached is a patch that moves the chdir() call before the skip test
detection. This resolved the error for me.

Regards,
  Bastian

- -- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 2.6.24treasure1 (PREEMPT)
Locale: [EMAIL PROTECTED], [EMAIL PROTECTED] (charmap=ISO-8859-15)
Shell: /bin/sh linked to /bin/bash

- -- no debconf information

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFHpuQAeBwlBDLsbz4RAkyIAJ4tQzYkQFxo6ki3qQc8nqFZBkx+cwCgygOf
UoLZARRgC42N6v0x/G73QWQ=
=3pt+
-----END PGP SIGNATURE-----
--- mr  2008-02-04 02:11:30.937987767 +0100
+++ /usr/bin/mr 2008-02-04 10:11:10.000000000 +0100
@@ -432,6 +432,14 @@
 
        $ENV{MR_REPO}=$dir;
 
+       if ($is_checkout && ! -d $dir) {
+               print "mr $action: creating parent directory $dir\n" if 
$verbose;
+               system("mkdir", "-p", $dir);
+       }
+       if (! $no_chdir && ! chdir($dir)) {
+               print STDERR "mr $action: failed to chdir to $dir: $!\n";
+               return FAILED;
+       }
        my $skiptest=findcommand("skip", $dir, $topdir, $subdir, $is_checkout);
        my $command=findcommand($action, $dir, $topdir, $subdir, $is_checkout);
 
@@ -456,16 +464,7 @@
                }
        }
 
-       if ($is_checkout && ! -d $dir) {
-               print "mr $action: creating parent directory $dir\n" if 
$verbose;
-               system("mkdir", "-p", $dir);
-       }
-
-       if (! $no_chdir && ! chdir($dir)) {
-               print STDERR "mr $action: failed to chdir to $dir: $!\n";
-               return FAILED;
-       }
-       elsif (! defined $command) {
+       if (! defined $command) {
                my $rcs=rcs_test(@_);
                if (! defined $rcs) {
                        print STDERR "mr $action: unknown repository type and 
no defined $action command for $topdir$subdir\n";

Reply via email to