Skip to content
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

add initial support for Git protocol v2 #1244

Merged
merged 12 commits into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
39 changes: 32 additions & 7 deletions dulwich/cli.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,22 @@ def run(self, args):
type=str,
help=("Check out branch instead of branch pointed to by remote " "HEAD"),
)
parser.add_option(
"--refspec",
dest="refspec",
type=str,
help="References to fetch",
action="append",
)
parser.add_option(
"--filter",
dest="filter_spec",
type=str,
help="git-rev-list-style object filter",
)
parser.add_option(
"--protocol", dest="protocol", type=int, help="Git protocol version to use"
)
options, args = parser.parse_args(args)

if args == []:
Expand All @@ -282,6 +298,9 @@ def run(self, args):
bare=options.bare,
depth=options.depth,
branch=options.branch,
refspec=options.refspec,
filter_spec=options.filter_spec,
protocol_version=options.protocol,
)
except GitProtocolError as e:
print(f"{e}")
Expand Down Expand Up @@ -586,13 +605,19 @@ def run(self, args):

class cmd_pull(Command):
def run(self, args):
parser = optparse.OptionParser()
options, args = parser.parse_args(args)
try:
from_location = args[0]
except IndexError:
from_location = None
porcelain.pull(".", from_location)
parser = argparse.ArgumentParser()
parser.add_argument("from_location", type=str)
parser.add_argument("refspec", type=str, nargs="*")
parser.add_argument("--filter", type=str, nargs=1)
parser.add_argument("--protocol", type=int, nargs=1)
args = parser.parse_args(args)
porcelain.pull(
".",
args.from_location or None,
args.refspec or None,
filter_spec=args.filter,
protocol_version=args.protocol_version or None,
)


class cmd_push(Command):
Expand Down
Loading
Loading