Rugged :: Index #add를 사용하여 색인에 새 파일을 추가하려고합니다. 인덱스에 성공적으로 추가 된 것으로 보이지만 연관된 Rugged :: Repository #status 이 지정된 파일에 대해 지워집니다.Rugged :: Repository #status는 Rugged를 사용하여 색인에 파일을 추가 할 때 지워진 상태를보고합니다.
가 파일 "TEST_JJV_IRB1"를 추가 내 시도>> path = "TEST_JJV_IRB1"
=> "TEST_JJV_IRB1"
>> FileUtils.touch("#{local_repo}/#{path}")
=> ["/var/tmp/d20141015-95025-c5bbxe/TEST_JJV_IRB1"]
>> repo.inspect
=> "#<Rugged::Repository:70155837868280 {path: \"/private/var/tmp/d20141015-95025-c5bbxe/.git/\"}>"
새로 생성 된 파일 "TEST_JJV_IRB1"을 보여주는
예 IRB 세션이 제대로 견고한 :: 저장소 #status에 의해보고
>> repo.status(path)
=> [:worktree_new]
및 올바르게 Rugged :: Index에 포함되지 않음
>> index = repo.index
=> #<Rugged::Index
[0] 'a_file'
[0] 'b_file'
[0] 'c_file'
여기에 새로운 파일을 색인에 추가하십시오.
>> oid = Rugged::Blob.from_workdir repo, path
=> "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"
>> index.add(:path => path, :oid => oid, :mode => 0100644)
=> nil
>> index.write
=> nil
파일 "TEST_JJV_IRB1"이 색인에 올바르게 추가되었습니다.
>> repo.index
=> #<Rugged::Index
[0] 'a_file'
[0] 'b_file'
[0] 'c_file'
[0] 'TEST_JJV_IRB1'
하지만 견고한 :: 저장소 #status보고 기대
>> repo.status(path)
=> []
견고한 :: 저장소 #status 클리어로는 상태를보고 있어요 : 기묘 git status
을 발행
[index_new]를 명령 줄에서 새 파일 "TEST_JJV_IRB1"을 "커밋 할 변경 내용 :"으로 표시합니다.
% git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
new file: TEST_JJV_IRB1
나는 매우 잘 Rugged :: Index #add를 잘못 사용했을 수도 있습니다 ...? –