summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Michael Haggerty <mhagger@alum.mit.edu>2015-07-01 17:05:58 +0200
committerLibravatar Junio C Hamano <gitster@pobox.com>2015-07-01 09:29:59 -0700
commit28c7b1f7b7b70013c2f380c2d720d0c918d3d83a (patch)
tree29c3eac7402f612bb43573b987a036315cdbec2d /t
parentGit 2.4 (diff)
downloadtgif-28c7b1f7b7b70013c2f380c2d720d0c918d3d83a.tar.xz
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')
-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 aac126fd57..9984c48b5a 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 &&