[BUG] 'stg add FILE' when FILE is a symlink to dir adds dir contents

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <git@...>, Catalin Marinas <catalin.marinas@...>
Date: Wednesday, April 11, 2007 - 11:54 am

Hello,

I have noticed that 'stg add FILE' works differently from 'git add
FILE' when file is a symlink to the directory: StGIT adds the contents
of dir, while GIT adds the symlink itself.

In stgit/git.py we see:



I have no knowledge of Python, so I can't fix it myself, but perhaps
one should check for symlink before 'if os.path.isdir(i):'.  This also
will fix 'elif os.path.isfile(i):' branch if 'os.path.normpath(i)'
call dereferences symlinks (I'm not sure if that is the case).

But curious, why does the code traverse the tree itself?  Why not to
give the file list directly to git-update-index, and let it decide
what files to add, and how?  I also guess the code doesn't honor
.gitignore.

Could 'names' list be passed to git-update-index directly?


-- 
   Tomash Brechko
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[BUG] 'stg add FILE' when FILE is a symlink to dir adds dir ..., Tomash Brechko, (Wed Apr 11, 11:54 am)