Skip to contentSkip to conversation

Make sure git clone gets the right kernel branch

PATCH Jeremy Fitzhardinge 1 participant 1 message Apr 29, 2010

lore
Share & tools
lore
#0 lore raw

When cloning kernel repo:
1. make remote called "xen" rather than the default "origin"
2. directly checkout the desired branch, rather than the default then the desired one

Git 1.5 doesn't support -b on git clone, and seems to do something odd with the checkout branch argument, so avoid using the newer commandline options.

buildconfigs/src.git-clone +3 -4
diff -r 9a1d7caa2024 buildconfigs/src.git-clone
@@ -23,9 +23,8 @@
 	if ! [ -d $(LINUX_SRCDIR) ]; then \
 		rm -rf $(LINUX_SRCDIR) $(LINUX_SRCDIR).tmp; \
 		mkdir $(LINUX_SRCDIR).tmp; rmdir $(LINUX_SRCDIR).tmp; \
-		$(GIT) clone $(XEN_LINUX_GIT_URL) $(LINUX_SRCDIR).tmp; \
-		cd $(LINUX_SRCDIR).tmp; \
-		$(GIT) checkout $(XEN_LINUX_GIT_REMOTEBRANCH); \
-		cd ..; mv $(LINUX_SRCDIR).tmp $(LINUX_SRCDIR); \
+		$(GIT) clone -o xen -n $(XEN_LINUX_GIT_URL) $(LINUX_SRCDIR).tmp; \
+		(cd $(LINUX_SRCDIR).tmp; git checkout -b $(XEN_LINUX_GIT_REMOTEBRANCH) xen/$(XEN_LINUX_GIT_REMOTEBRANCH) ); \
+		mv $(LINUX_SRCDIR).tmp $(LINUX_SRCDIR); \
 	fi
 	touch $@