← Back to team overview

dulwich-users team mailing list archive

Re: [PATCH v3 3/4] repo.Repo.get_named_file: normalize case

 

On Mon, Dec 27, 2010 at 12:15:45AM +0800, Tay Ray Chuan wrote:
> While we're at it, refactor normalization operations into a separate
> function, so we just need to look at one place if we want to change
> path normalizations.
> ---
>  dulwich/repo.py |    6 +++++-
>  1 files changed, 5 insertions(+), 1 deletions(-)
> 
> diff --git a/dulwich/repo.py b/dulwich/repo.py
> index 99c1df8..b1ebd2a 100644
> --- a/dulwich/repo.py
> +++ b/dulwich/repo.py
> @@ -1086,6 +1086,10 @@ class BaseRepo(object):
>          return c.id
>  
>  
> +def _norm_path(path):
> +    return os.path.normcase(os.path.realpath(path))
Thanks for the patches.

I'm not sure this is a useful thing to factor out.

Also, why the os.path.realpath? We're just going to open these files, why do we care 
about their canonical location?

Cheers,

Jelmer



Follow ups

References