Bug 1261397

Summary: Failing 'rhpkg switch-branch' gives too little information
Product: [Fedora] Fedora Reporter: Tomáš Hozza <thozza>
Component: rpkgAssignee: Ales Raszka <araszka>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: rawhideCC: araszka, dennis, pbabinca, s, ttomecek
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-02-22 13:19:30 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Tomáš Hozza 2015-09-09 08:56:51 UTC
Description of problem:
When I executed 'rhpkg switch-branch' inside a dist-git repository, the command fails with message that is too vague:

$ rhpkg switch-branch rhel-6.8 
Could not execute switch_branch: Could not check out rhel-6.8

One is not able to figure out what is the problem. I had to use directly 'git checkout' to get some meaningful error message. 

Version-Release number of selected component (if applicable):
rhpkg-1.26-1.fc22.noarch

How reproducible:
always if you have the the proper situation in your repository

Steps to Reproduce:
1. branch $(A) contains tracked file $(file)
2. branch $(B) does NOT contain file $(file)
3. switch to branch $(B)
4. touch $(file)
5. switch back to branch $(a) using 'rhpkg switch-branch'

Actual results:
$ rhpkg switch-branch rhel-6.8 
Could not execute switch_branch: Could not check out rhel-6.8

Expected results:
some meaningful error message helping me to resolve the issue.

Additional info:
Git gives such a meaningful error message.

$ git checkout rhel-6.8
error: The following untracked working tree files would be overwritten by checkout:
	bind98-CVE-2015-5722.patch
Please move or remove them before you can switch branches.
Aborting

Comment 1 Ales Raszka 2015-10-05 09:22:19 UTC
Pull-request: https://pagure.io/rpkg/pull-request/21