You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not sure whether this is a bug or considered valid (though probably strange) usage, but Index.add() - and presumably Index.add_all() as well as IndexEntry, too - accept paths where even non-final components are symbolic links, like in symlink-to-dir/some-non-dir-file`.
git-add itself rejects these with an error like:
$ git add symlink-to-dir/some-non-dir-file
fatal: pathspec 'symlink-to-dir/some-non-dir-file' is beyond a symbolic link
The Index object even uses these pathnames and doesn't just resolve them:
Now the problem with such pathnames is that symlink-to-dir is not added as a symbolic link to the index (at least not automatically), instead it seems to behave as if there were a true directory of that name which contained the file, but which is then immediately gone after adding.
IMO hat leads to all kinds of unexpected stuff (which is probably the reason why git-add forbids it instead of e.g either resolving it or doing something else (like resolving it and adding the file under its real dir).
Maybe pygit2 should also reject these? Not sure what libgit2 does, though.
Cheers,
Chris.
The text was updated successfully, but these errors were encountered:
Hey.
Not sure whether this is a bug or considered valid (though probably strange) usage, but
Index.add()
- and presumablyIndex.add_all() as well as
IndexEntry, too - accept paths where even non-final components are symbolic links, like in
symlink-to-dir/some-non-dir-file`.git-add
itself rejects these with an error like:The Index object even uses these pathnames and doesn't just resolve them:
Creating a commit of that works, too.
Now the problem with such pathnames is that
symlink-to-dir
is not added as a symbolic link to the index (at least not automatically), instead it seems to behave as if there were a true directory of that name which contained the file, but which is then immediately gone after adding.IMO hat leads to all kinds of unexpected stuff (which is probably the reason why git-add forbids it instead of e.g either resolving it or doing something else (like resolving it and adding the file under its real dir).
Maybe pygit2 should also reject these? Not sure what libgit2 does, though.
Cheers,
Chris.
The text was updated successfully, but these errors were encountered: