Skip to content

Add support for unshallow #377

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 24, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add support for unshallow
Signed-off-by: Stephen Paul Weber <singpolyma@singpolyma.net>
  • Loading branch information
singpolyma committed Aug 7, 2018
commit a86eb24622efa5192d806dd2274bb324c864fb4c
1 change: 1 addition & 0 deletions lib/git/lib.rb
Original file line number Diff line number Diff line change
Expand Up @@ -747,6 +747,7 @@ def fetch(remote, opts)
arr_opts << opts[:ref] if opts[:ref]
arr_opts << '--tags' if opts[:t] || opts[:tags]
arr_opts << '--prune' if opts[:p] || opts[:prune]
arr_opts << '--unshallow' if opts[:unshallow]

command('fetch', arr_opts)
end
Expand Down
11 changes: 10 additions & 1 deletion tests/units/test_lib.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,16 @@ def setup
set_file_paths
@lib = Git.open(@wdir).lib
end


def test_fetch_unshallow
in_temp_dir do |dir|
git = Git.clone("file://#{@wdir}", "shallow", path: dir, depth: 1).lib
assert_equal(1, git.log_commits.length)
git.fetch("file://#{@wdir}", unshallow: true)
assert_equal(71, git.log_commits.length)
end
end

def test_commit_data
data = @lib.commit_data('1cc8667014381')
assert_equal('scott Chacon <schacon@agadorsparticus.corp.reactrix.com> 1194561188 -0800', data['author'])
Expand Down