summaryrefslogtreecommitdiff
path: root/t/t9300-fast-import.sh
diff options
context:
space:
mode:
authorMichael Haggerty <mhagger@alum.mit.edu>2015-07-01 15:05:58 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-07-01 16:29:59 (GMT)
commit28c7b1f7b7b70013c2f380c2d720d0c918d3d83a (patch)
tree29c3eac7402f612bb43573b987a036315cdbec2d /t/t9300-fast-import.sh
parent3d4a3ffe64162b45ae7c991fc60623ecb4678cfd (diff)
downloadgit-28c7b1f7b7b70013c2f380c2d720d0c918d3d83a.zip
git-28c7b1f7b7b70013c2f380c2d720d0c918d3d83a.tar.gz
git-28c7b1f7b7b70013c2f380c2d720d0c918d3d83a.tar.bz2
fast-import: add a get-mark command
It is sometimes useful for importers to be able to read the SHA-1 corresponding to a mark that they have created via fast-import. For example, they might want to embed the SHA-1 into the commit message of a later commit. Or it might be useful for internal bookkeeping uses, or for logging. Add a "get-mark" command to "git fast-import" that allows the importer to ask for the value of a mark that has been created earlier. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t9300-fast-import.sh')
-rwxr-xr-xt/t9300-fast-import.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh
index aac126f..9984c48 100755
--- a/t/t9300-fast-import.sh
+++ b/t/t9300-fast-import.sh
@@ -2339,6 +2339,19 @@ test_expect_success !MINGW 'R: in-stream cat-blob-fd not respected' '
test_cmp expect actual.1
'
+test_expect_success !MINGW 'R: print mark for new blob' '
+ echo "effluentish" | git hash-object --stdin >expect &&
+ git fast-import --cat-blob-fd=6 6>actual <<-\EOF &&
+ blob
+ mark :1
+ data <<BLOB_END
+ effluentish
+ BLOB_END
+ get-mark :1
+ EOF
+ test_cmp expect actual
+'
+
test_expect_success !MINGW 'R: print new blob' '
blob=$(echo "yep yep yep" | git hash-object --stdin) &&
cat >expect <<-EOF &&