diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2009-11-25 16:07:45 +0100 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2009-11-25 16:07:45 +0100 |
commit | 9c92df685d6c600a0a3324dff08a4d00d829a4f5 (patch) | |
tree | c9ba910674f6d3c397ce5f7bdd5991fa5f50a099 /lib/git/objects/base.py | |
parent | e40b5f075bdb9d6c2992a0a1cf05f7f6f4f101a3 (diff) | |
download | gitpython-9c92df685d6c600a0a3324dff08a4d00d829a4f5.tar.gz |
diff: added __str__ method to diff class
IndexObject._mode_str_to_int: Now uses the 6 relevant bytes of the passed in octal string
Diffstat (limited to 'lib/git/objects/base.py')
-rw-r--r-- | lib/git/objects/base.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/git/objects/base.py b/lib/git/objects/base.py index c66263c0..c7bf5bf2 100644 --- a/lib/git/objects/base.py +++ b/lib/git/objects/base.py @@ -184,14 +184,16 @@ class IndexObject(Object): def _mode_str_to_int(cls, modestr): """ ``modestr`` - string like 755 or 644 or 100644 - only the last 3 chars will be used + string like 755 or 644 or 100644 - only the last 6 chars will be used Returns String identifying a mode compatible to the mode methods ids of the - stat module regarding the rwx permissions for user, group and other + stat module regarding the rwx permissions for user, group and other, + special flags and file system flags, i.e. whether it is a symlink + for example. """ mode = 0 - for iteration,char in enumerate(reversed(modestr[-3:])): + for iteration,char in enumerate(reversed(modestr[-6:])): mode += int(char) << iteration*3 # END for each char return mode |