Bug 546580 - does not throw exception while cloning unavailable branch
Summary: does not throw exception while cloning unavailable branch
Status: RESOLVED FIXED
Alias: None
Product: JGit
Classification: Technology
Component: JGit (show other bugs)
Version: 5.3   Edit
Hardware: PC Linux
: P3 blocker (vote)
Target Milestone: 5.11   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-04-18 21:20 EDT by Kailash Neupane CLA
Modified: 2021-02-23 16:17 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kailash Neupane CLA 2019-04-18 21:20:34 EDT
let the repo be 'https://github.com/vuvova/gdb-tools'.
This repo doesnot have master branch.

cloning master branch from shell gives this error:
$: git clone https://github.com/vuvova/gdb-tools --branch master
Cloning into 'gdb-tools'...
fatal: Remote branch master not found in upstream origin

But when running the code:
Git.cloneRepository()
      .setProgressMonitor(new TextProgressMonitor(new PrintWriter(System.out)))
      .setURI(uri)
      .setDirectory(dir)
      .setBranch("master")
      .call()

shows as if repo is cloned. But when i see in the folder, only .git is present.
It doesnot even throws exception that master branch is not available.
Comment 1 Eclipse Genie CLA 2021-01-23 18:22:12 EST
New Gerrit change created: https://git.eclipse.org/r/c/jgit/jgit/+/175264