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

repository: Resolve commit when cloning annotated tag, fixes #557 #558

Merged
merged 1 commit into from
Aug 27, 2017

Conversation

orirawlings
Copy link
Contributor

@orirawlings orirawlings commented Aug 24, 2017

Fixes #557

@orirawlings orirawlings requested a review from mcuadros August 24, 2017 03:44
@orirawlings
Copy link
Contributor Author

Tests are pending still, but wanted to make sure my general approach made sense. I still have to dig into how the current tests for the repository Clone* methods are implemented.

repository.go Outdated
case plumbing.CommitObject:
return h, nil
default:
return plumbing.ZeroHash, errors.New("Unable to resolve to commit")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Whoops. Forgot to extract an error constant here.

@codecov
Copy link

codecov bot commented Aug 24, 2017

Codecov Report

Merging #558 into master will decrease coverage by 0.65%.
The diff coverage is 67.74%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #558      +/-   ##
==========================================
- Coverage    78.1%   77.44%   -0.66%     
==========================================
  Files         129      129              
  Lines        9807     9827      +20     
==========================================
- Hits         7660     7611      -49     
- Misses       1316     1394      +78     
+ Partials      831      822       -9
Impacted Files Coverage Δ
repository.go 73.71% <67.74%> (-1.02%) ⬇️
plumbing/transport/ssh/common.go 20.54% <0%> (-45.21%) ⬇️
plumbing/transport/ssh/auth_method.go 31.57% <0%> (-22.81%) ⬇️

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 2f58c82...17cde59. Read the comment docs.

@orirawlings
Copy link
Contributor Author

orirawlings commented Aug 24, 2017

I've added a failing test. My current strategy prevents an error from occurring, but it leaves the HEAD ref pointed to the tag object rather the underlying commit object. Standard git tooling leaves the HEAD ref pointed at the commit. I'll continue working on this fix.

@orirawlings
Copy link
Contributor Author

I fixed the PR to ensure that the HEAD ref is left pointing to the commit object.

@mcuadros mcuadros merged commit 631a45f into src-d:master Aug 27, 2017
@orirawlings orirawlings deleted the cloneAnnotatedTag branch August 28, 2017 13:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants