summaryrefslogtreecommitdiff
path: root/tests/test-refs.sh
diff options
context:
space:
mode:
authorYu Qi Zhang <jzehrarnyg@gmail.com>2016-06-23 16:11:50 +0000
committerAtomic Bot <atomic-devel@projectatomic.io>2016-06-23 19:52:26 +0000
commit02a2b689dda4fe69491d526a8e1f4f12f5a32bdf (patch)
tree95f13e3aae4ba9db936306d2efccaa03fcf60ed6 /tests/test-refs.sh
parentfc4a7ec35e6e7a3a2db80257508faa592329786c (diff)
downloadostree-02a2b689dda4fe69491d526a8e1f4f12f5a32bdf.tar.gz
refs: resolve conflict between local/remote repos
Add the functionality to use the same name for refs in local and remote repos. This helps users keep track of local refs of remote origin, much like local and remote git branches. Previously, when a local ref is specified, resolve_refspec would fall back to searching through remote repos if the ref is not found locally. This function now takes an extra flag to specify whether it should search through remote repos. Additionally, ostree_repo_resove_rev_ext was added to call resolve_refspec with fallback_remote being false, so refs --create would no longer complain when trying to create a local ref of the same name as a remote one. Fix remote repo parsing not being handled correctly on refs --create. Closes: #363 Approved by: jlebon
Diffstat (limited to 'tests/test-refs.sh')
-rwxr-xr-xtests/test-refs.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test-refs.sh b/tests/test-refs.sh
index 310b586f..ee7841bd 100755
--- a/tests/test-refs.sh
+++ b/tests/test-refs.sh
@@ -104,4 +104,16 @@ ${CMD_PREFIX} ostree --repo=repo refs ctest --create=foo
${CMD_PREFIX} ostree --repo=repo refs | wc -l > refscount.create4
assert_file_has_content refscount.create4 "^6$"
+#Check if a name for a ref in remote repo can be used locally, and vice versa.
+${CMD_PREFIX} ostree --repo=repo commit --branch=origin:remote1
+${CMD_PREFIX} ostree --repo=repo commit --branch=local1
+${CMD_PREFIX} ostree --repo=repo refs | wc -l > refscount.create5
+assert_file_has_content refscount.create5 "^8$"
+
+${CMD_PREFIX} ostree --repo=repo refs origin:remote1 --create=remote1
+${CMD_PREFIX} ostree --repo=repo refs origin:remote1 --create=origin/remote1
+${CMD_PREFIX} ostree --repo=repo refs local1 --create=origin:local1
+${CMD_PREFIX} ostree --repo=repo refs | wc -l > refscount.create6
+assert_file_has_content refscount.create6 "^11$"
+
echo "ok refs"