-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Description
Disclaimer - this is a fresh build environment by someone who has not built git-lfs previously.
In my cibuild, the track-outside test, which asserts that you cannot git lfs track '../*.foo' from the top-level of the test-repo, where .. is also not a repo, fails (in other words the command succeeds whereas the test asserts failure):
test: track outside git repo ... FAILED
-- stdout --
Tracking *.foo
Initialized empty Git repository in <redacted>/git-lfs/tmp/test-track.sh-4149/track-outside/.git/
Tracking *.file
Tracking ../*.foo
-- stderr --
+ set -e
+ git lfs track '*.foo'
+ '[' -n '' ']'
+ git init track-outside
+ cd track-outside
+ git lfs track '*.file'
+ git lfs track '../*.foo'
+ exit 1
+ test_status=1
-- git trace --
17:20:48.996693 git.c:561 trace: exec: 'git-lfs' 'track' '*.foo'
17:20:48.996749 run-command.c:334 trace: run_command: 'git-lfs' 'track' '*.foo'
17:20:49.041419 git.c:344 trace: built-in: git 'init' 'track-outside'
17:20:49.043785 git.c:561 trace: exec: 'git-lfs' 'track' '*.file'
17:20:49.043821 run-command.c:334 trace: run_command: 'git-lfs' 'track' '*.file'
17:20:49.052885 git.c:561 trace: exec: 'git-lfs' 'track' '../*.foo'
17:20:49.052948 run-command.c:334 trace: run_command: 'git-lfs' 'track' '../*.foo'
If I revert in current master commit 51e2819, which changes relevant code in command_track.go, the test passes again (git-lfs refuses to add track in non-git parent). The only complicating factor I can think of is that track-outside/../../.. is my git-lfs clone, although the interceding directories are obviously not part of that repo.
The changed-code seems satisfied as long as my command is run from within the repo. That might be the intention based on the commit comment "pass gitattributes patterns (mostly) unchanged".
Is allowing that track path now allowed, making the test incorrect? Does the test need modifying or removal?
Is there a central CI build hosted anywhere, and is the test failing there?