pre-commit hook script fails if git commit is done after a change to add a soft link to a directory
Final Release Note
Description
I created sr_armv6l
as a soft link to sr_armv7l
and then tried to commit.
-
But got some errors from the pre-commit script (see output below). But it did end up committing.
-
After the commit, I noticed an extra file was created (see below output). I manually deleted that file and moved on.
Both need to be fixed so the hook works without issues.
$ cd YDB
$ ln -s sr_armv7l sr_armv6l
$ git add --ignore-removal .
$ git commit -a -S -m 'Create sr_armv6l as a soft link to sr_armv7l'
Traceback (most recent call last):
File "ci/copyright.py", line 126, in <module>
main()
File "ci/copyright.py", line 117, in main
with open(sys.argv[1], "r") as f:
IsADirectoryError: [Errno 21] Is a directory: 'sr_armv6l'
note: automatically committing copyright updates to sr_armv6l
grep: sr_armv6l: Is a directory
[scantypedefs 75635f97] temporary
1 file changed, 1 insertion(+)
create mode 120000 sr_armv6l
$ git status
On branch scantypedefs
Untracked files:
(use "git add <file>..." to include in what will be committed)
sr_armv7l/tmp.CuUcTZRAcv
nothing added to commit but untracked files present (use "git add" to track)
$ rm sr_armv7l/tmp.CuUcTZRAcv