mirror of
https://github.com/facebook/sapling.git
synced 2024-10-04 13:57:13 +03:00
Update integration tests to use valid git pull
Summary: All the integration tests related to `git pull` used it as `git pull https://hostname/repos/git/ro/repo.git`. This doesn't function as a standard pull, i.e. just `git pull`. [This SO post](https://stackoverflow.com/questions/48749715/what-does-git-pull-link-to-remote-do) explains the detailed difference but fundamentally using pull with a remote URL ends up using a default ref spec that works only for branches (i.e. `+refs/heads/*:refs/remotes/origin/*`). This makes us miss out tags from the server. This diff updates the integration tests to make use of just `git pull` so that we pull all refs (heads and tags). Reviewed By: mitrandir77 Differential Revision: D56979746 fbshipit-source-id: a309ef656dfb1e179cf342041729a9e5920539e6
This commit is contained in:
parent
6c1dbeeca4
commit
cd3d2615b1
@ -90,6 +90,7 @@
|
||||
$ cd "$GIT_REPO"
|
||||
$ quiet git pull "$GIT_REPO_ORIGIN"
|
||||
# Capture all the known Git objects from the repo
|
||||
$ cd $GIT_REPO_ORIGIN
|
||||
$ git rev-list --objects --all | git cat-file --batch-check='%(objectname) %(objecttype) %(rest)' | sort > $TESTTMP/object_list
|
||||
|
||||
# Import the newly added commits to Mononoke
|
||||
@ -99,7 +100,7 @@
|
||||
$ cd $REPONAME
|
||||
# Wait for the warm bookmark cache to catch up with the latest changes
|
||||
$ wait_for_git_bookmark_move HEAD $current_head
|
||||
$ quiet git_client pull $MONONOKE_GIT_SERVICE_BASE_URL/$REPONAME.git
|
||||
$ quiet git_client pull
|
||||
# Verify that we get the same Git repo back that we started with
|
||||
$ git rev-list --objects --all | git cat-file --batch-check='%(objectname) %(objecttype) %(rest)' | sort > $TESTTMP/new_object_list
|
||||
$ diff -w $TESTTMP/new_object_list $TESTTMP/object_list
|
||||
|
@ -77,6 +77,7 @@
|
||||
$ cd "$GIT_REPO"
|
||||
$ quiet git pull "$GIT_REPO_ORIGIN"
|
||||
# Capture all the known Git objects from the repo
|
||||
$ cd $GIT_REPO_ORIGIN
|
||||
$ git rev-list --objects --all | git cat-file --batch-check='%(objectname) %(objecttype) %(rest)' | sort > $TESTTMP/object_list_after_pull
|
||||
# Diff the list of objects before and after the pull to show that we got new objects
|
||||
$ diff -w -q $TESTTMP/object_list $TESTTMP/object_list_after_pull
|
||||
@ -90,7 +91,7 @@
|
||||
$ cd $REPONAME
|
||||
# Wait for the warm bookmark cache to catch up with the latest changes
|
||||
$ wait_for_git_bookmark_move HEAD $current_head
|
||||
$ quiet git_client pull $MONONOKE_GIT_SERVICE_BASE_URL/$REPONAME.git
|
||||
$ quiet git_client pull
|
||||
# Verify that we get the same Git repo back that we started with
|
||||
$ git rev-list --objects --all | git cat-file --batch-check='%(objectname) %(objecttype) %(rest)' | sort > $TESTTMP/new_object_list
|
||||
$ diff -w $TESTTMP/new_object_list $TESTTMP/object_list_after_pull
|
||||
|
@ -63,11 +63,14 @@
|
||||
$ echo "this is fileB.this is fileB.this is fileB.this is fileB.this is fileB.this is fileB.this is fileB.this is fileB" > fileB
|
||||
$ git add fileB
|
||||
$ git commit -qam "Reverted fileB.1 -> fileB"
|
||||
$ git tag -a -m "last tag" last_tag
|
||||
$ echo "this is fileB.2 this is fileB.2 this is fileB.2 this is fileB.2 this is fileB.2 this is fileB.2 this is fileB.2.this is fileB.2" > fileB
|
||||
$ git add fileB
|
||||
$ git commit -qam "Modified fileB -> fileB.2"
|
||||
|
||||
$ cd "$GIT_REPO"
|
||||
$ quiet git pull "$GIT_REPO_ORIGIN"
|
||||
# Capture all the known Git objects from the repo
|
||||
$ cd $GIT_REPO_ORIGIN
|
||||
$ git rev-list --objects --all | git cat-file --batch-check='%(objectname) %(objecttype) %(rest)' | sort > $TESTTMP/object_list
|
||||
|
||||
# Import the newly added commits to Mononoke
|
||||
@ -77,7 +80,7 @@
|
||||
$ cd $REPONAME
|
||||
# Wait for the warm bookmark cache to catch up with the latest changes
|
||||
$ wait_for_git_bookmark_move HEAD $current_head
|
||||
$ quiet git_client pull $MONONOKE_GIT_SERVICE_BASE_URL/$REPONAME.git
|
||||
$ quiet git_client pull
|
||||
# Verify that we get the same Git repo back that we started with
|
||||
$ git rev-list --objects --all | git cat-file --batch-check='%(objectname) %(objecttype) %(rest)' | sort > $TESTTMP/new_object_list
|
||||
$ diff -w $TESTTMP/new_object_list $TESTTMP/object_list
|
||||
|
@ -66,6 +66,7 @@
|
||||
$ cd "$GIT_REPO"
|
||||
$ quiet git pull "$GIT_REPO_ORIGIN"
|
||||
# Capture all the known Git objects from the repo
|
||||
$ cd $GIT_REPO_ORIGIN
|
||||
$ git rev-list --objects --all | git cat-file --batch-check='%(objectname) %(objecttype) %(rest)' | sort > $TESTTMP/object_list
|
||||
|
||||
# Import the newly added commits to Mononoke
|
||||
@ -76,7 +77,7 @@
|
||||
$ cd $REPONAME
|
||||
# Wait for the warm bookmark cache to catch up with the latest changes
|
||||
$ wait_for_git_bookmark_move HEAD $current_head
|
||||
$ quiet git_client pull $MONONOKE_GIT_SERVICE_BASE_URL/$REPONAME.git
|
||||
$ quiet git_client pull
|
||||
# Verify that we get the same Git repo back that we started with
|
||||
$ git rev-list --objects --all | git cat-file --batch-check='%(objectname) %(objecttype) %(rest)' | sort > $TESTTMP/new_object_list
|
||||
$ diff -w $TESTTMP/new_object_list $TESTTMP/object_list
|
||||
|
Loading…
Reference in New Issue
Block a user