This repository has been archived by the owner on Apr 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remote-helper: Fix
FETCH_HEAD
setting on fetch
The `git2` crate is not reliable at setting the `FETCH_HEAD` on fetch. Therefore we disable that feature, and let the git command-line do its thing.
- Loading branch information
Showing
7 changed files
with
265 additions
and
4 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
This is a simple test to ensure the behavior of our remote helper is correct. | ||
|
||
``` ~alice | ||
$ git rev-parse master | ||
f2de534b5e81d7c6e2dcaf58c3dd91573c0a0354 | ||
$ git checkout -b alice/1 -q | ||
$ git commit --allow-empty -m "Change #1" -q | ||
$ git rev-parse HEAD | ||
7461703ce0fda972df450d071d1d3702057a6352 | ||
$ git push rad HEAD:alice/1 | ||
``` | ||
|
||
``` ~bob | ||
$ git status | ||
On branch master | ||
Your branch is up to date with 'rad/master'. | ||
nothing to commit, working tree clean | ||
$ git fetch --all | ||
Fetching rad | ||
Fetching alice@z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi | ||
$ cat .git/FETCH_HEAD | ||
7461703ce0fda972df450d071d1d3702057a6352 not-for-merge branch 'alice/1' of rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi | ||
f2de534b5e81d7c6e2dcaf58c3dd91573c0a0354 not-for-merge branch 'master' of rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi | ||
$ git merge FETCH_HEAD | ||
Already up to date. | ||
$ git rev-parse master | ||
f2de534b5e81d7c6e2dcaf58c3dd91573c0a0354 | ||
$ git rev-parse HEAD | ||
f2de534b5e81d7c6e2dcaf58c3dd91573c0a0354 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
Ensure that we're able to pull our own branches if they happened to be deleted | ||
in our working copy. This also applies to a situation with multiple working | ||
copies. | ||
|
||
``` | ||
$ git checkout -b alice/1 -q | ||
$ git commit --allow-empty -m "Changes #1" -q | ||
$ git push rad -o patch.message="Changes" HEAD:refs/patches | ||
``` | ||
|
||
``` | ||
$ git checkout master -q | ||
$ git branch -D alice/1 -q | ||
$ git update-ref -d refs/remotes/rad/alice/1 | ||
$ git update-ref -d refs/remotes/rad/patches/34dff44b9e86f0bdb1a65ee5b6ef90ce6e7af70d | ||
$ git gc --prune=now | ||
$ git branch -r | ||
rad/master | ||
``` | ||
|
||
``` | ||
$ git pull | ||
Already up to date. | ||
$ git branch -r | ||
rad/master | ||
rad/patches/34dff44b9e86f0bdb1a65ee5b6ef90ce6e7af70d | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
Testing pulling, fetching and the `FETCH_HEAD`. | ||
|
||
``` ~bob | ||
$ git push rad | ||
$ git checkout -b bob/1 -q | ||
$ git commit --allow-empty -m "Changes #1" -q | ||
$ git push -o patch.message="Changes" rad HEAD:refs/patches | ||
$ rad sync -a | ||
✓ Synced with 1 node(s) | ||
``` | ||
|
||
``` ~alice | ||
$ git checkout -b alice/1 -q | ||
$ git rev-parse HEAD | ||
f2de534b5e81d7c6e2dcaf58c3dd91573c0a0354 | ||
$ git checkout master -q | ||
$ rad patch checkout 0fd67a0 | ||
✓ Switched to branch patch/0fd67a0 | ||
✓ Branch patch/0fd67a0 setup to track rad/patches/0fd67a0364af1f79ed8770a35ed09d85571d4c21 | ||
$ rad remote add z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk | ||
✓ Remote bob@z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk added | ||
✓ Remote-tracking branch bob@z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk/master created for z6Mkt67…v4N1tRk | ||
$ git checkout master -q | ||
$ git fetch --all -q | ||
$ cat .git/FETCH_HEAD | ||
f2de534b5e81d7c6e2dcaf58c3dd91573c0a0354 branch 'master' of rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji | ||
8d5f1bae4b69d8e3f6cbfc6f4bd675ed19990afc not-for-merge branch 'patches/0fd67a0364af1f79ed8770a35ed09d85571d4c21' of rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji | ||
f2de534b5e81d7c6e2dcaf58c3dd91573c0a0354 not-for-merge branch 'master' of rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk | ||
8d5f1bae4b69d8e3f6cbfc6f4bd675ed19990afc not-for-merge branch 'patches/0fd67a0364af1f79ed8770a35ed09d85571d4c21' of rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk | ||
$ git rev-parse master | ||
f2de534b5e81d7c6e2dcaf58c3dd91573c0a0354 | ||
``` | ||
|
||
``` ~alice (stderr) | ||
$ git checkout patch/0fd67a0 -q | ||
$ git commit --allow-empty -m "Changes #2" -q | ||
$ git push | ||
✓ Patch 0fd67a0 updated to c360232989049f6d95efe3512e68608317333a5e | ||
✓ Synced with 1 node(s) | ||
To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi | ||
* [new branch] patch/0fd67a0 -> patches/0fd67a0364af1f79ed8770a35ed09d85571d4c21 | ||
``` | ||
|
||
``` ~bob | ||
$ git commit --allow-empty -m "Changes #2" -q | ||
$ git push | ||
``` | ||
|
||
``` ~alice (stderr) | ||
$ git checkout master -q | ||
$ git pull | ||
✓ Synced with 1 peer(s) | ||
From rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji | ||
+ c2aaf1c...8d5f1ba patches/0fd67a0364af1f79ed8770a35ed09d85571d4c21 -> rad/patches/0fd67a0364af1f79ed8770a35ed09d85571d4c21 (forced update) | ||
$ git checkout - -q | ||
$ git commit --allow-empty -m "Changes #3" -q | ||
$ git push | ||
✓ Patch 0fd67a0 updated to c4115970191cd0e67212b6d26ad9e3bd992dce35 | ||
✓ Synced with 1 node(s) | ||
To rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji/z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi | ||
c2aaf1c..d9f8caf patch/0fd67a0 -> patches/0fd67a0364af1f79ed8770a35ed09d85571d4c21 | ||
``` | ||
|
||
``` ~alice | ||
$ cat .git/FETCH_HEAD | ||
f2de534b5e81d7c6e2dcaf58c3dd91573c0a0354 branch 'master' of rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji | ||
8d5f1bae4b69d8e3f6cbfc6f4bd675ed19990afc not-for-merge branch 'patches/0fd67a0364af1f79ed8770a35ed09d85571d4c21' of rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji | ||
``` | ||
|
||
``` ~bob (stderr) | ||
$ git checkout master -q | ||
$ git pull | ||
✓ Synced with 1 peer(s) | ||
From rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji | ||
+ c2aaf1c...8d5f1ba patches/0fd67a0364af1f79ed8770a35ed09d85571d4c21 -> rad/patches/0fd67a0364af1f79ed8770a35ed09d85571d4c21 (forced update) | ||
``` | ||
|
||
``` ~bob | ||
$ git rev-parse master | ||
f2de534b5e81d7c6e2dcaf58c3dd91573c0a0354 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters