-
Notifications
You must be signed in to change notification settings - Fork 534
worktree: Add create and push the blob objects to the storer #441
Conversation
worktree_commit.go
Outdated
|
||
_, err = h.s.SetEncodedObject(obj) | ||
return err | ||
return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this return
worktree_status.go
Outdated
func (w *Worktree) copySymlinkToStorage(path string, fi os.FileInfo) (hash plumbing.Hash, err error) { | ||
obj := w.r.Storer.NewEncodedObject() | ||
obj.SetType(plumbing.BlobObject) | ||
obj.SetSize(fi.Size()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Object creation. Duplicated code.
worktree_status.go
Outdated
if err != nil { | ||
return plumbing.ZeroHash, err | ||
} | ||
|
||
h := plumbing.NewHasher(plumbing.BlobObject, int64(len(target))) | ||
_, err = h.Write([]byte(target)) | ||
defer ioutil.CheckClose(writer, &err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
duplicated code too in writer and check close.
worktree_status.go
Outdated
return plumbing.ZeroHash, err | ||
} | ||
|
||
return w.r.Storer.SetEncodedObject(obj) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicated code too.
Signed-off-by: Máximo Cuadros <mcuadros@gmail.com>
Codecov Report
@@ Coverage Diff @@
## master #441 +/- ##
==========================================
- Coverage 77.91% 77.38% -0.53%
==========================================
Files 127 127
Lines 9208 9172 -36
==========================================
- Hits 7174 7098 -76
- Misses 1246 1308 +62
+ Partials 788 766 -22
Continue to review full report at Codecov.
|
Blob creation moved from
Worktree.Commit
toWorktree.Add
Fixes #427