Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 353255

Summary: Fetch factory does not checkout tag/branch after initial clone of repo
Product: [Technology] EGit Reporter: Andrew Niefer <aniefer>
Component: CoreAssignee: Project Inbox <egit.core-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, david_williams, dj.houghton, kim.moir, pwebster, remy.suen
Version: 0.12   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
log file none

Description Andrew Niefer CLA 2011-07-27 17:04:57 EDT
Created attachment 200477 [details]
log file

When running the fetch factory to get code from a repository for the first time (ie, the repo has not been previously cloned for the build), then the appropriate tag/branch does not get checked out, the repo remains on master as a default.  This is a problem when building for a branch.

The cause is that the checkout task "GitCheckoutTagInLocalRepo" is conditional on a property indicating the existance of the clone.
Things go like this:
1) check for repo & set property if it exists
2) if property is set (repo exists) update the repo
3) if property is not set (repo does not exist), clone the repo
4) if property is set, checkout tag 
5) re-check for repo existance and set property
6) if property is set, copy code


At step 4 we do not do the checkout because the property is still not set.
We should be rechecking repo existance and setting the property before trying to checkout a tag.

See attached log file for this in action
Comment 1 Andrew Niefer CLA 2011-07-27 17:20:37 EDT
http://egit.eclipse.org/r/3934
Comment 2 Andrew Niefer CLA 2011-07-28 14:43:59 EDT
The patch referred to in comment #1 was merged in by Gunnar.
I gave Kim a jar with these changes and she is running with them.

I'm marking this fixed, but I'm not sure what target milestone to put on it since I don't know where egit is with their releases.