Skip to content

git lfs not check git file system before start tracking files #293

@aorjoa

Description

@aorjoa

File tracking not check necessary items before (git lfs require git file system and into git influence directory) , to prevent error I will hack some code for support this issue and I will show reproduce issue as below. ( I think it's like #200 but duplicate line of tracking file in my case)

System environments
git-lfs/0.5.1 (GitHub; darwin amd64; git 2.0.1; go 1.4.1) on Mac OS X : Yosemity 10.10.4

I woking in directory contain a testfile.png and use git lfs without git file system

$ git lfs track "testfile.png"
Tracking testfile.png

.gitattributes was created and I looking into file

$ cat .gitattributes
testfile.png filter=lfs diff=lfs merge=lfs -crlf

then use git lfs track again

$ git lfs track "testfile.png"
Tracking testfile.png

and read it

$ cat .gitattributes
testfile.png filter=lfs diff=lfs merge=lfs -crlf
testfile.png filter=lfs diff=lfs merge=lfs -crlf

It seem like git lfs not check git file system before. but if git already in the directory it’s warnning user about file exits in git lfs system (.gitattributes).

create git file system

$ git init
Initialized empty Git repository in /Users/AorJoa/repository/test_check_git_exists/.git/

git check tracking file before add any line

$ git lfs track "testfile.png"
testfile.png already supported

and file contains two line of tracking file

$ cat .gitattributes 
testfile.png filter=lfs diff=lfs merge=lfs -crlf
testfile.png filter=lfs diff=lfs merge=lfs -crlf

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions