Merge branch 'jh/fetch-head-update'
* jh/fetch-head-update: write first for-merge ref to FETCH_HEAD first
This commit is contained in:
commit
1067f8dd0e
@ -341,7 +341,7 @@ since you pulled from him:
|
||||
|
||||
----------------
|
||||
$ git fetch git://.... linus
|
||||
$ LT=`cat .git/FETCH_HEAD`
|
||||
$ LT=`git rev-parse FETCH_HEAD`
|
||||
----------------
|
||||
|
||||
Your work tree is still based on your HEAD ($JC), but you have
|
||||
|
@ -377,6 +377,7 @@ static int store_updated_refs(const char *raw_url, const char *remote_name,
|
||||
const char *what, *kind;
|
||||
struct ref *rm;
|
||||
char *url, *filename = dry_run ? "/dev/null" : git_path("FETCH_HEAD");
|
||||
int want_merge;
|
||||
|
||||
fp = fopen(filename, "a");
|
||||
if (!fp)
|
||||
@ -393,9 +394,22 @@ static int store_updated_refs(const char *raw_url, const char *remote_name,
|
||||
goto abort;
|
||||
}
|
||||
|
||||
/*
|
||||
* The first pass writes objects to be merged and then the
|
||||
* second pass writes the rest, in order to allow using
|
||||
* FETCH_HEAD as a refname to refer to the ref to be merged.
|
||||
*/
|
||||
for (want_merge = 1; 0 <= want_merge; want_merge--) {
|
||||
for (rm = ref_map; rm; rm = rm->next) {
|
||||
struct ref *ref = NULL;
|
||||
|
||||
commit = lookup_commit_reference_gently(rm->old_sha1, 1);
|
||||
if (!commit)
|
||||
rm->merge = 0;
|
||||
|
||||
if (rm->merge != want_merge)
|
||||
continue;
|
||||
|
||||
if (rm->peer_ref) {
|
||||
ref = xcalloc(1, sizeof(*ref) + strlen(rm->peer_ref->name) + 1);
|
||||
strcpy(ref->name, rm->peer_ref->name);
|
||||
@ -404,9 +418,6 @@ static int store_updated_refs(const char *raw_url, const char *remote_name,
|
||||
ref->force = rm->peer_ref->force;
|
||||
}
|
||||
|
||||
commit = lookup_commit_reference_gently(rm->old_sha1, 1);
|
||||
if (!commit)
|
||||
rm->merge = 0;
|
||||
|
||||
if (!strcmp(rm->name, "HEAD")) {
|
||||
kind = "";
|
||||
@ -473,6 +484,7 @@ static int store_updated_refs(const char *raw_url, const char *remote_name,
|
||||
fprintf(stderr, " %s\n", note.buf);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (rc & STORE_REF_ERROR_DF_CONFLICT)
|
||||
error(_("some local refs could not be updated; try running\n"
|
||||
|
@ -70,8 +70,8 @@ test_expect_success "fetch test for-merge" '
|
||||
master_in_two=`cd ../two && git rev-parse master` &&
|
||||
one_in_two=`cd ../two && git rev-parse one` &&
|
||||
{
|
||||
echo "$master_in_two not-for-merge"
|
||||
echo "$one_in_two "
|
||||
echo "$master_in_two not-for-merge"
|
||||
} >expected &&
|
||||
cut -f -2 .git/FETCH_HEAD >actual &&
|
||||
test_cmp expected actual'
|
||||
|
@ -1,6 +1,6 @@
|
||||
# br-branches-default-merge
|
||||
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../
|
||||
0567da4d5edd2ff4bb292a465ba9e64dcad9536b branch 'three' of ../
|
||||
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../
|
||||
6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
|
||||
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
|
||||
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
|
||||
|
@ -1,6 +1,6 @@
|
||||
# br-branches-default-merge branches-default
|
||||
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../
|
||||
0567da4d5edd2ff4bb292a465ba9e64dcad9536b branch 'three' of ../
|
||||
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../
|
||||
6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
|
||||
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
|
||||
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
|
||||
|
@ -1,7 +1,7 @@
|
||||
# br-branches-default-octopus
|
||||
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../
|
||||
8e32a6d901327a23ef831511badce7bf3bf46689 branch 'one' of ../
|
||||
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 branch 'two' of ../
|
||||
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../
|
||||
6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
|
||||
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
|
||||
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
|
||||
|
@ -1,7 +1,7 @@
|
||||
# br-branches-default-octopus branches-default
|
||||
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../
|
||||
8e32a6d901327a23ef831511badce7bf3bf46689 branch 'one' of ../
|
||||
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 branch 'two' of ../
|
||||
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../
|
||||
6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
|
||||
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
|
||||
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
|
||||
|
@ -1,6 +1,6 @@
|
||||
# br-branches-one-merge
|
||||
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge branch 'one' of ../
|
||||
0567da4d5edd2ff4bb292a465ba9e64dcad9536b branch 'three' of ../
|
||||
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge branch 'one' of ../
|
||||
6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
|
||||
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
|
||||
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
|
||||
|
@ -1,6 +1,6 @@
|
||||
# br-branches-one-merge branches-one
|
||||
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge branch 'one' of ../
|
||||
0567da4d5edd2ff4bb292a465ba9e64dcad9536b branch 'three' of ../
|
||||
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge branch 'one' of ../
|
||||
6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
|
||||
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
|
||||
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
|
||||
|
@ -1,8 +1,8 @@
|
||||
# br-config-explicit-merge
|
||||
0567da4d5edd2ff4bb292a465ba9e64dcad9536b branch 'three' of ../
|
||||
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../
|
||||
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge branch 'one' of ../
|
||||
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../
|
||||
0567da4d5edd2ff4bb292a465ba9e64dcad9536b branch 'three' of ../
|
||||
6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
|
||||
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
|
||||
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
|
||||
|
@ -1,8 +1,8 @@
|
||||
# br-config-explicit-merge config-explicit
|
||||
0567da4d5edd2ff4bb292a465ba9e64dcad9536b branch 'three' of ../
|
||||
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../
|
||||
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge branch 'one' of ../
|
||||
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../
|
||||
0567da4d5edd2ff4bb292a465ba9e64dcad9536b branch 'three' of ../
|
||||
6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
|
||||
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
|
||||
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
|
||||
|
@ -1,7 +1,7 @@
|
||||
# br-config-explicit-octopus
|
||||
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../
|
||||
8e32a6d901327a23ef831511badce7bf3bf46689 branch 'one' of ../
|
||||
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 branch 'two' of ../
|
||||
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../
|
||||
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../
|
||||
6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
|
||||
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
|
||||
|
@ -1,7 +1,7 @@
|
||||
# br-config-explicit-octopus config-explicit
|
||||
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../
|
||||
8e32a6d901327a23ef831511badce7bf3bf46689 branch 'one' of ../
|
||||
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 branch 'two' of ../
|
||||
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../
|
||||
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../
|
||||
6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
|
||||
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
|
||||
|
@ -1,7 +1,7 @@
|
||||
# br-config-glob-merge
|
||||
0567da4d5edd2ff4bb292a465ba9e64dcad9536b branch 'three' of ../
|
||||
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../
|
||||
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge branch 'one' of ../
|
||||
0567da4d5edd2ff4bb292a465ba9e64dcad9536b branch 'three' of ../
|
||||
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../
|
||||
6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
|
||||
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
|
||||
|
@ -1,7 +1,7 @@
|
||||
# br-config-glob-merge config-glob
|
||||
0567da4d5edd2ff4bb292a465ba9e64dcad9536b branch 'three' of ../
|
||||
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../
|
||||
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge branch 'one' of ../
|
||||
0567da4d5edd2ff4bb292a465ba9e64dcad9536b branch 'three' of ../
|
||||
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../
|
||||
6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
|
||||
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
|
||||
|
@ -1,8 +1,8 @@
|
||||
# br-config-glob-octopus
|
||||
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../
|
||||
8e32a6d901327a23ef831511badce7bf3bf46689 branch 'one' of ../
|
||||
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../
|
||||
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 branch 'two' of ../
|
||||
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../
|
||||
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../
|
||||
6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
|
||||
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
|
||||
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
|
||||
|
@ -1,8 +1,8 @@
|
||||
# br-config-glob-octopus config-glob
|
||||
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../
|
||||
8e32a6d901327a23ef831511badce7bf3bf46689 branch 'one' of ../
|
||||
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../
|
||||
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 branch 'two' of ../
|
||||
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../
|
||||
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../
|
||||
6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
|
||||
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
|
||||
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
|
||||
|
@ -1,8 +1,8 @@
|
||||
# br-remote-explicit-merge
|
||||
0567da4d5edd2ff4bb292a465ba9e64dcad9536b branch 'three' of ../
|
||||
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../
|
||||
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge branch 'one' of ../
|
||||
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../
|
||||
0567da4d5edd2ff4bb292a465ba9e64dcad9536b branch 'three' of ../
|
||||
6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
|
||||
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
|
||||
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
|
||||
|
@ -1,8 +1,8 @@
|
||||
# br-remote-explicit-merge remote-explicit
|
||||
0567da4d5edd2ff4bb292a465ba9e64dcad9536b branch 'three' of ../
|
||||
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../
|
||||
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge branch 'one' of ../
|
||||
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../
|
||||
0567da4d5edd2ff4bb292a465ba9e64dcad9536b branch 'three' of ../
|
||||
6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
|
||||
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
|
||||
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
|
||||
|
@ -1,7 +1,7 @@
|
||||
# br-remote-explicit-octopus
|
||||
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../
|
||||
8e32a6d901327a23ef831511badce7bf3bf46689 branch 'one' of ../
|
||||
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 branch 'two' of ../
|
||||
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../
|
||||
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../
|
||||
6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
|
||||
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
|
||||
|
@ -1,7 +1,7 @@
|
||||
# br-remote-explicit-octopus remote-explicit
|
||||
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../
|
||||
8e32a6d901327a23ef831511badce7bf3bf46689 branch 'one' of ../
|
||||
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 branch 'two' of ../
|
||||
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../
|
||||
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../
|
||||
6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
|
||||
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
|
||||
|
@ -1,7 +1,7 @@
|
||||
# br-remote-glob-merge
|
||||
0567da4d5edd2ff4bb292a465ba9e64dcad9536b branch 'three' of ../
|
||||
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../
|
||||
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge branch 'one' of ../
|
||||
0567da4d5edd2ff4bb292a465ba9e64dcad9536b branch 'three' of ../
|
||||
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../
|
||||
6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
|
||||
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
|
||||
|
@ -1,7 +1,7 @@
|
||||
# br-remote-glob-merge remote-glob
|
||||
0567da4d5edd2ff4bb292a465ba9e64dcad9536b branch 'three' of ../
|
||||
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../
|
||||
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge branch 'one' of ../
|
||||
0567da4d5edd2ff4bb292a465ba9e64dcad9536b branch 'three' of ../
|
||||
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 not-for-merge branch 'two' of ../
|
||||
6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
|
||||
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
|
||||
|
@ -1,8 +1,8 @@
|
||||
# br-remote-glob-octopus
|
||||
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../
|
||||
8e32a6d901327a23ef831511badce7bf3bf46689 branch 'one' of ../
|
||||
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../
|
||||
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 branch 'two' of ../
|
||||
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../
|
||||
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../
|
||||
6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
|
||||
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
|
||||
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
|
||||
|
@ -1,8 +1,8 @@
|
||||
# br-remote-glob-octopus remote-glob
|
||||
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../
|
||||
8e32a6d901327a23ef831511badce7bf3bf46689 branch 'one' of ../
|
||||
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../
|
||||
6134ee8f857693b96ff1cc98d3e2fd62b199e5a8 branch 'two' of ../
|
||||
754b754407bf032e9a2f9d5a9ad05ca79a6b228f not-for-merge branch 'master' of ../
|
||||
0567da4d5edd2ff4bb292a465ba9e64dcad9536b not-for-merge branch 'three' of ../
|
||||
6c9dec2b923228c9ff994c6cfe4ae16c12408dc5 not-for-merge tag 'tag-master' of ../
|
||||
8e32a6d901327a23ef831511badce7bf3bf46689 not-for-merge tag 'tag-one' of ../
|
||||
22feea448b023a2d864ef94b013735af34d238ba not-for-merge tag 'tag-one-tree' of ../
|
||||
|
Loading…
Reference in New Issue
Block a user