Skip to content

Commit 1b48d56

Browse files
committed
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 2c3af7e (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 <[email protected]> Tested-by: Michael Cronenworth <[email protected]>
1 parent 6a3d05d commit 1b48d56

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

git-cvsserver.perl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4167,7 +4167,7 @@ sub convertToDbMode
41674167
# this half-converted form, but it isn't currently worth the
41684168
# backwards compatibility headaches.
41694169

4170-
$mode=~/^\d\d(\d)\d{3}$/;
4170+
$mode=~/^\d{3}(\d)\d\d$/;
41714171
my $userBits=$1;
41724172

41734173
my $dbMode = "";

0 commit comments

Comments
 (0)