Skip to contentSkip to conversation

git-p4: Fix error message crash in P4Sync.commit.

PATCH In review Tor Arvid Lund 2 participants 2 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 git-p4: Fix error message crash in P4Sync.commit.

There is an error message that crashes the script because of an invalid ref to the non-existing "path" variable. It is almost never printed, which would explain why nobody encountered this problem before... But anyway, this oneliner fixes it.

---
 contrib/fast-import/git-p4 |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
contrib/fast-import/git-p4 +1 -1
index ca3cea0..29b9e32 100755
@@ -1086,7 +1086,7 @@ class P4Sync(Command):
             if [p for p in branchPrefixes if p4PathStartsWith(f['path'], p)]:
                 new_files.append (f)
             else:
-                sys.stderr.write("Ignoring file outside of prefix: %s\n" % path)
+                sys.stderr.write("Ignoring file outside of prefix: %s\n" % f['path'])
 
         self.gitStream.write("commit %s\n" % branch)
 #        gitStream.write("mark :%s\n" % details["change"])
Signature · 1 line
1.7.3.1.68.g06779.dirty
Acked-by on v1 1/1
#1 lore raw

[email protected] wrote on Tue, 08 Feb 2011 13:20 +0100:

Quoted 4 lines

There is an error message that crashes the script because of an invalid ref to the non-existing "path" variable. It is almost never printed, which would explain why nobody encountered this problem before... But anyway, this oneliner fixes it.

Needs signoff.

Quoted 25 lines
---
 contrib/fast-import/git-p4 |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
contrib/fast-import/git-p4 +1 -1
index ca3cea0..29b9e32 100755
@@ -1086,7 +1086,7 @@ class P4Sync(Command):
             if [p for p in branchPrefixes if p4PathStartsWith(f['path'], p)]:
                 new_files.append (f)
             else:
-                sys.stderr.write("Ignoring file outside of prefix: %s\n" % path)
+                sys.stderr.write("Ignoring file outside of prefix: %s\n" % f['path'])
 
         self.gitStream.write("commit %s\n" % branch)
 #        gitStream.write("mark :%s\n" % details["change"])
Signature · 6 lines
1.7.3.1.68.g06779.dirty

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html