-
Notifications
You must be signed in to change notification settings - Fork 285
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨(clone): set publicheads to remote HEAD when cloning (#607)
Summary: ✨(clone): set publicheads to remote HEAD when cloning c8b66c6 added support for cloning the remote git repo's HEAD (in this case `develop`), instead of main/master by default. However, this doesn't mark `remote/develop` and its ancestors as public commits. This commit will also set remote git repo's HEAD as a public commit Closes #600 Pull Request resolved: #607 Pull Request resolved: #607 Test Plan: - Added test `test-git-clone-sets-publicheads.t` Reviewed By: sggutier Differential Revision: D45249747 Pulled By: zzl0 fbshipit-source-id: 8c3a36bd21a25a856d13cc3b2c78f9cbdd9a94c5
- Loading branch information
1 parent
b5d3aab
commit 0ce7010
Showing
2 changed files
with
49 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#debugruntest-compatible | ||
#require git no-windows | ||
|
||
$ . $TESTDIR/git.sh | ||
|
||
Prepare a git repo: | ||
|
||
$ git init -q gitrepo | ||
$ cd gitrepo | ||
$ git config core.autocrlf false | ||
$ echo 1 > alpha | ||
$ git add alpha | ||
$ git commit -q -malpha | ||
|
||
$ git switch -c foo | ||
Switched to a new branch 'foo' | ||
|
||
$ echo 2 > beta | ||
$ git add beta | ||
$ git commit -q -mbeta | ||
|
||
Test git clone sets publicheads | ||
$ hg clone --git "$TESTTMP/gitrepo" cloned | ||
From $TESTTMP/gitrepo | ||
* [new ref] 3f5848713286c67b8a71a450e98c7fa66787bde2 -> remote/foo | ||
2 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||
$ cd cloned | ||
$ hg config remotenames.publicheads | ||
remote/foo,remote/main,remote/master |