summaryrefslogtreecommitdiff
path: root/t/t2104-update-index-gitfile.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-01-20 14:38:34 -0800
committerJunio C Hamano <gitster@pobox.com>2010-01-20 14:38:34 -0800
commitbd0d1916de221425fc22b69940ff71b0ce6aad9c (patch)
treede5b8e222e87202fc4c7159cb284a165f101939f /t/t2104-update-index-gitfile.sh
parentc757c52f63cfaa9446f9ae93e44acc6ca610650f (diff)
parent40c813e00c8de5725c7a6bb127fadedcce1f788f (diff)
downloadgit-bd0d1916de221425fc22b69940ff71b0ce6aad9c.tar.gz
Merge branch 'bk/fix-relative-gitdir-file'
* bk/fix-relative-gitdir-file: Handle relative paths in submodule .git files Test update-index for a gitlink to a .git file
Diffstat (limited to 't/t2104-update-index-gitfile.sh')
-rwxr-xr-xt/t2104-update-index-gitfile.sh38
1 files changed, 38 insertions, 0 deletions
diff --git a/t/t2104-update-index-gitfile.sh b/t/t2104-update-index-gitfile.sh
new file mode 100755
index 0000000000..641607d89a
--- /dev/null
+++ b/t/t2104-update-index-gitfile.sh
@@ -0,0 +1,38 @@
+#!/bin/sh
+#
+# Copyright (c) 2010 Brad King
+#
+
+test_description='git update-index for gitlink to .git file.
+'
+
+. ./test-lib.sh
+
+test_expect_success 'submodule with absolute .git file' '
+ mkdir sub1 &&
+ (cd sub1 &&
+ git init &&
+ REAL="$(pwd)/.real" &&
+ mv .git "$REAL"
+ echo "gitdir: $REAL" >.git &&
+ test_commit first)
+'
+
+test_expect_success 'add gitlink to absolute .git file' '
+ git update-index --add -- sub1
+'
+
+test_expect_success 'submodule with relative .git file' '
+ mkdir sub2 &&
+ (cd sub2 &&
+ git init &&
+ mv .git .real &&
+ echo "gitdir: .real" >.git &&
+ test_commit first)
+'
+
+test_expect_success 'add gitlink to relative .git file' '
+ git update-index --add -- sub2
+'
+
+test_done