Skip to content
This repository was archived by the owner on Sep 11, 2020. It is now read-only.

worktree: Add create and push the blob objects to the storer #441

Merged
merged 1 commit into from
Jun 19, 2017
Merged

worktree: Add create and push the blob objects to the storer #441

merged 1 commit into from
Jun 19, 2017

Conversation

mcuadros
Copy link
Contributor

Blob creation moved from Worktree.Commit to Worktree.Add

Fixes #427

@mcuadros mcuadros requested review from smola and ajnavarro June 19, 2017 11:00
@mcuadros mcuadros changed the title worktree: Add create and push the blog objects to the storer worktree: Add create and push the blob objects to the storer Jun 19, 2017

_, err = h.s.SetEncodedObject(obj)
return err
return
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this return

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())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Object creation. Duplicated code.

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)
Copy link
Contributor

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.

return plumbing.ZeroHash, err
}

return w.r.Storer.SetEncodedObject(obj)
Copy link
Contributor

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
Copy link

codecov bot commented Jun 19, 2017

Codecov Report

Merging #441 into master will decrease coverage by 0.52%.
The diff coverage is 82.85%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
worktree_status.go 70.45% <80%> (-0.5%) ⬇️
worktree_commit.go 74.19% <90%> (+4.4%) ⬆️
plumbing/transport/ssh/common.go 0% <0%> (-50.91%) ⬇️
plumbing/transport/ssh/auth_method.go 33.33% <0%> (-24.77%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ad74323...85a9126. Read the comment docs.

@mcuadros mcuadros merged commit dfd68a1 into src-d:master Jun 19, 2017
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants