Don't track files outside repository
This commit is contained in:
parent
ec756f6b15
commit
3145f2ddf0
@ -56,6 +56,12 @@ func trackCommand(cmd *cobra.Command, args []string) {
|
||||
ArgsLoop:
|
||||
for _, t := range args {
|
||||
absT, relT := absRelPath(t, wd)
|
||||
|
||||
if !filepath.HasPrefix(absT, lfs.LocalWorkingDir) {
|
||||
Print("%s is outside repository", t)
|
||||
os.Exit(128)
|
||||
}
|
||||
|
||||
for _, k := range knownPaths {
|
||||
absK, _ := absRelPath(k.Path, filepath.Join(wd, filepath.Dir(k.Source)))
|
||||
if absT == absK {
|
||||
|
Loading…
Reference in New Issue
Block a user