summaryrefslogtreecommitdiff
path: root/git-cvsserver.perl
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-09-10 22:33:06 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-09-11 16:32:30 (GMT)
commit1b48d56cfb006baf12d34b5e3150ba2ec1900e08 (patch)
treed53909d8cc0dcc53afece06a5fea2b9fb72f9cd1 /git-cvsserver.perl
parent6a3d05da55a488a4f5b2c3b2091f4445fa3847e9 (diff)
downloadgit-1b48d56cfb006baf12d34b5e3150ba2ec1900e08.zip
git-1b48d56cfb006baf12d34b5e3150ba2ec1900e08.tar.gz
git-1b48d56cfb006baf12d34b5e3150ba2ec1900e08.tar.bz2
cvsserver: pick up the right mode bits
When determining the file mode from either ls-tree or diff-tree output, we used to grab these octal mode string (typically 100644 or 100755) and then did $git_perms .= "r" if ( $mode & 4 ); $git_perms .= "w" if ( $mode & 2 ); $git_perms .= "x" if ( $mode & 1 ); which was already wrong, as (100644 & 4) is very different from oct("100644") & 4. An earlier refactoring 2c3af7e7 (cvsserver: factor out git-log parsing logic, 2012-10-13) further changed it to pick the third octal digit (10*0*644 or 10*0*755) from the left and then do the above conversion, which does not make sense, either. Let's use the third digit from the last of the octal mode string to make sure we get the executable and read bits right. Signed-off-by: Junio C Hamano <gitster@pobox.com> Tested-by: Michael Cronenworth <mike@cchtml.com>
Diffstat (limited to 'git-cvsserver.perl')
-rwxr-xr-xgit-cvsserver.perl2
1 files changed, 1 insertions, 1 deletions
diff --git a/git-cvsserver.perl b/git-cvsserver.perl
index 3679074..dfda2b7 100755
--- a/git-cvsserver.perl
+++ b/git-cvsserver.perl
@@ -4167,7 +4167,7 @@ sub convertToDbMode
# this half-converted form, but it isn't currently worth the
# backwards compatibility headaches.
- $mode=~/^\d\d(\d)\d{3}$/;
+ $mode=~/^\d{3}(\d)\d\d$/;
my $userBits=$1;
my $dbMode = "";