Skip to content

Commit

Permalink
refactor: remove fetchOrigin
Browse files Browse the repository at this point in the history
- use `fetch` then `rebase <branch>` instead
- will consider adding back if needed.
  • Loading branch information
minh committed Aug 5, 2024
1 parent a358571 commit 643d08e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 29 deletions.
7 changes: 0 additions & 7 deletions src/main/java/org/nqm/command/GitCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,6 @@ void rebaseOrigin(@Parameters(index = "0", paramLabel = "<branch name>") String
printOutput(forEachModuleDo("rebase", "%s/%s".formatted(ORIGIN, branch)));
}

@Deprecated(forRemoval = true)
@Command(name = "fetch-origin", aliases = "fo",
description = "Download objects and refs specified by branch name from other repositories")
void fetchOrigin(@Parameters(index = "0", paramLabel = "<branch name>") String branch) throws IOException {
printOutput(forEachModuleDo("fetch", ORIGIN, "%s:%s".formatted(branch, branch)));
}

@Command(name = CHECKOUT, aliases = "co", description = "Switch branches or restore working tree files")
void checkout(@Parameters(index = "0", paramLabel = "<branch name>") String branch) throws IOException {
printOutput(forEachModuleDo(CHECKOUT, branch));
Expand Down
22 changes: 0 additions & 22 deletions src/test/java/org/nqm/command/GitCommandIntTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -446,28 +446,6 @@ void checkout_OK() throws IOException {
"" + tempPath.getFileName());
}

@Test
void fetchOrigin_OK() throws IOException {
// given:
var repos = create_clone_gitRepositories("po_1_z", "po_2_zz", "po_3_zzz");
gis.init();
gis.spinOff("batabranch");
commitFile(repos);
System.setIn(new ByteArrayInputStream("yes".getBytes()));
gis.push("batabranch", true, true, false);
gis.spinOff("master");
commitFile(repos);

// when:
resetOutputStreamTest();
gis.fetchOrigin("batabranch");

// then:
assertThat(stripColors.apply(outCaptor.toString()))
.containsExactlyInAnyOrder("po_1_z", "po_2_zz", "po_3_zzz",
"" + tempPath.getFileName());
}

@Test
void stash_OK() throws IOException {
// given:
Expand Down

0 comments on commit 643d08e

Please sign in to comment.