Skip to content

fork: Allow forking from remotes other than "origin"#564

Merged
bmeneg merged 1 commit intozaquestion:masterfrom
fmuellner:fork-edge-case
Jan 22, 2021
Merged

fork: Allow forking from remotes other than "origin"#564
bmeneg merged 1 commit intozaquestion:masterfrom
fmuellner:fork-edge-case

Conversation

@fmuellner
Copy link
Copy Markdown
Contributor

The fork command can be used in two ways:

  1. when passed a namespaced project name (e.g. "SomeGroup/AwesomeProject"),
    the project is forked (and optionally cloned)
  2. without arguments, the project name is determined from the "origin"
    remote in the current repository, forked and added as remote

The second mode currently doesn't work if the repository pointed to by
"origin" doesn't use the Namespace/Project structure gitlab expects.

Support that use case by also picking the second mode when the passed
argument corresponds to an existing remote.

Fixes #563

@prarit
Copy link
Copy Markdown
Collaborator

prarit commented Jan 21, 2021

Hi, due to no fault of yours the lab test code was broken. I have fixed the tests in #575 and #573 . Can you please rebase to see if your build will past testing? My sincere apologies for the inconvenience.

The fork command can be used in two ways:

 1. when passed a namespaced project name (e.g. "SomeGroup/AwesomeProject"),
    the project is forked (and optionally cloned)
 2. without arguments, the project name is determined from the "origin"
    remote in the current repository, forked and added as remote

The second mode currently doesn't work if the repository pointed to by
"origin" doesn't use the Namespace/Project structure gitlab expects.

Support that use case by also picking the second mode when the passed
argument corresponds to an existing remote.

Fixes zaquestion#563
@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 21, 2021

Codecov Report

Merging #564 (78cb696) into master (7c2c165) will decrease coverage by 0.13%.
The diff coverage is 50.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #564      +/-   ##
==========================================
- Coverage   58.30%   58.16%   -0.14%     
==========================================
  Files          64       64              
  Lines        4197     4205       +8     
==========================================
- Hits         2447     2446       -1     
- Misses       1516     1523       +7     
- Partials      234      236       +2     
Impacted Files Coverage Δ
cmd/fork.go 53.84% <50.00%> (-7.59%) ⬇️

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 7c2c165...78cb696. Read the comment docs.

@bmeneg bmeneg merged commit 102b81b into zaquestion:master Jan 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

lab fork doesn't work with any remote except origin

3 participants